diff options
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/configuration.php | 3 | ||||
-rw-r--r-- | engine/lib/database.php | 18 |
2 files changed, 9 insertions, 12 deletions
diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php index 66b36bf63..d60b7b8f3 100644 --- a/engine/lib/configuration.php +++ b/engine/lib/configuration.php @@ -39,6 +39,9 @@ $CONFIG->wwwroot .= str_replace($_SERVER['DOCUMENT_ROOT'],"",$CONFIG->path);
}
+ if (empty($CONFIG->url))
+ $CONFIG->url = $CONFIG->wwwroot;
+
if (empty($CONFIG->sitename))
$CONFIG->sitename = "New Elgg site";
diff --git a/engine/lib/database.php b/engine/lib/database.php index fab73025e..1d78ac310 100644 --- a/engine/lib/database.php +++ b/engine/lib/database.php @@ -264,11 +264,12 @@ $tables = array();
- if (is_array($result)) {
+ if (is_array($result) && !empty($result)) {
foreach($result as $row) {
- foreach($row as $element) {
- $tables[] = $element;
- }
+ if (is_array($row) && !empty($row))
+ foreach($row as $element) {
+ $tables[] = $element;
+ }
}
}
@@ -306,13 +307,6 @@ $statement = str_replace("prefix_",$CONFIG->dbprefix,$statement);
if (!empty($statement)) {
$result = update_data($statement);
- if ($result == false) {
- $error = mysql_error();
- $error = trim($error);
- if (!empty($error)) {
- $errors[] = $error;
- }
- }
}
}
if (!empty($errors)) {
@@ -340,6 +334,6 @@ // Stuff for initialisation
- register_event_handler('init','system','init_db',0);
+ register_event_handler('boot','system','init_db',0);
?>
\ No newline at end of file |