- Patch #41644 by chx: critical bug: db_rewrite_sql had a bad regex.
parent
7f87b19eeb
commit
4ec8c0428e
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue