Function pager_query:

If the user, omits a $count_query argument and doesn't type the $query argument (sql string) for pager_query in upper case the $count_query will stay the same as $query.

Recommended fix:

File: pager.inc
Line: 65
Current line: $count_query = preg_replace(array('/SELECT.*?FROM /As', '/ORDER BY .*/'), array('SELECT COUNT(*) FROM ', ''), $query);
Recommended line: $count_query = preg_replace(array('/SELECT.*?FROM /iAs', '/ORDER BY .*/i'), array('SELECT COUNT(*) FROM ', ''), $query);

Note the "i" as a Pattern Modifier (after the last "/") on each regexp string.

Comments

KrisBuytaert’s picture

Seems like the bug is also stillin 5.X

http://drupal.org/node/115786

pasqualle’s picture

Status: Active » Closed (duplicate)