Commit 4ec8c042 authored by Dries's avatar Dries

- Patch #41644 by chx: critical bug: db_rewrite_sql had a bad regex.

parent 7f87b19e
......@@ -255,7 +255,7 @@ function _db_rewrite_sql($query = '', $primary_table = 'n', $primary_field = 'ni
}
/**
* Rewrites node queries.
* Rewrites node, taxonomy and comment queries. Use it for listing queries.
*
* @param $query
* Query to be rewritten.
......@@ -278,7 +278,7 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $
}
if (!empty($join)) {
$query = preg_replace('|FROM[^[:upper:]/,_]+|','\0 '. $join .' ', $query);
$query = preg_replace('/LEFT |RIGHT |INNER |WHERE|GROUP|ORDER|$/', $join .' \0', $query, 1);
}
if (!empty($where)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment