PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » Pager » Bug #9601

rewriteCountQuery (Page_Wrapper.php) does not handle query with 'UNION' keyword

Details

Submitted2006-12-12 17:04 UTC
Froms dot beni at planinformatica dot it
Assignedquipo
StatusClosed
PackagePager
PHP Version4.4.4
OSWin32
Roadmaps(Not assigned)

Comments

[2006-12-12 17:04 UTC] s dot beni at planinformatica dot it

Description:
------------
The function rewriteCountQuery into Page_Wrapper.php does not handle queries containing "UNION" keyword.
I think that the following modifications at the beginning of the function can solve this problem:

if (preg_match('/^\s*SELECT\s+\bDISTINCT\b/is', $sql) ||
preg_match('/\s+GROUP\s+BY\s+/is', $sql) ||
preg_match('/\s+UNION\s+/is', $sql)) { // patch
return false;
}