aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/database.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/database.php')
-rw-r--r--engine/lib/database.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index fa5b4a894..a9c4017a0 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -250,6 +250,12 @@ function explain_query($query, $link) {
function execute_query($query, $dblink) {
global $CONFIG, $dbcalls;
+ // remove newlines so logs are easier to read
+ $query = preg_replace("/[\r\n]/", "", $query);
+ if ($query == NULL) {
+ throw new DatabaseException(elgg_echo('DatabaseException:InvalidQuery'));
+ }
+
$dbcalls++;
$result = mysql_query($query, $dblink);