Commit d651b9dc authored by Dries's avatar Dries

- Patch #7535 by Gerhard: one could not search for the word 'From'.

parent 543d8b72
......@@ -55,7 +55,7 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = NULL) {
// Count the total number of records in this query.
if (!isset($count_query)) {
$count_query = preg_replace(array('/SELECT.*FROM/is', '/ORDER BY .*/'), array('SELECT COUNT(*) FROM', ''), $query);
$count_query = preg_replace(array('/SELECT.*?FROM/As', '/ORDER BY .*/'), array('SELECT COUNT(*) FROM', ''), $query);
}
$pager_total[$element] = db_result(call_user_func_array('db_query', array_merge(array($count_query), $args)));
......
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