From 7baa422117398b0fbf5e69393d96a734d182a94a Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 27 Mar 2011 02:23:12 +0000 Subject: Fixes #2591 removing newlines in queries - thanks to Tachyon git-svn-id: http://code.elgg.org/elgg/trunk@8869 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/database.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engine/lib/database.php') 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); -- cgit v1.2.3