Home » HTML » Pager » Bug #9601
rewriteCountQuery (Page_Wrapper.php) does not handle query with 'UNION' keyword
Details
| Submitted | 2006-12-12 17:04 UTC |
|---|---|
| From | s dot beni at planinformatica dot it |
| Assigned | quipo |
| Status | Closed |
| Package | Pager |
| PHP Version | 4.4.4 |
| OS | Win32 |
| 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;
}