From bdea3e9546dae4b370b2e111e1370308b7f00679 Mon Sep 17 00:00:00 2001 From: hawk__ Date: Wed, 9 May 2012 21:33:33 +0000 Subject: [PATCH] Added a modifier for COUNT(.+)...ORDER BY... to be handled correctly even when ther is a newline character git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@542085 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- pg4wp/driver_pgsql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index 16c2ceb..bacd202 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -205,7 +205,7 @@ $sql = preg_replace( '/CAST\((.+) AS CHAR\)/', 'CAST($1 AS TEXT)', $sql); // Handle COUNT(*)...ORDER BY... - $sql = preg_replace( '/COUNT(.+)ORDER BY.+/', 'COUNT$1', $sql); + $sql = preg_replace( '/COUNT(.+)ORDER BY.+/s', 'COUNT$1', $sql); // In order for users counting to work... $matches = array();