pager_query does not work when there is whitespace before the SELECT. Could be fixed by changing the regex from:

'/SELECT.*?FROM/As', '/ORDER BY .*/'

to:

'/ *SELECT.*?FROM/As', '/ORDER BY .*/'

or by putting a trim() around $query.

This bug also seems to be present in HEAD: http://api.drupal.org/api/HEAD/function/pager_query

Comments

damien tournoud’s picture

Status: Active » Closed (duplicate)

Duplicate of #288837: Pager.inc regexp misses whitespace use case, even if this one was older.