PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

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;
}