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);
'SecurityException:FunctionDenied' => "Access to privileged function '%s' is denied.",
'DatabaseException:DBSetupIssues' => "There were a number of issues: ",
'DatabaseException:ScriptNotFound' => "Elgg couldn't find the requested database script at %s.",
+ 'DatabaseException:InvalidQuery' => "Invalid query",
'IOException:FailedToLoadGUID' => "Failed to load new %s from GUID:%d",
'InvalidParameterException:NonElggObject' => "Passing a non-ElggObject to an ElggObject constructor!",