aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/database.php4
-rw-r--r--languages/en.php1
2 files changed, 5 insertions, 0 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index cc2b99f6a..7d90b30b8 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -253,6 +253,10 @@ function execute_query($query, $dblink) {
throw new DatabaseException(elgg_echo('DatabaseException:InvalidQuery'));
}
+ if (!is_resource($dblink)) {
+ throw new DatabaseException(elgg_echo('DatabaseException:InvalidDBLink'));
+ }
+
$dbcalls++;
$result = mysql_query($query, $dblink);
diff --git a/languages/en.php b/languages/en.php
index e9c333041..93096df38 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -56,6 +56,7 @@ $english = array(
'DatabaseException:DBSetupIssues' => "There were a number of issues: ",
'DatabaseException:ScriptNotFound' => "Elgg couldn't find the requested database script at %s.",
'DatabaseException:InvalidQuery' => "Invalid query",
+ 'DatabaseException:InvalidDBLink' => "Connection to database was lost.",
'IOException:FailedToLoadGUID' => "Failed to load new %s from GUID:%d",
'InvalidParameterException:NonElggObject' => "Passing a non-ElggObject to an ElggObject constructor!",