From b9479d45592c94770469208bfbc5a6662d07acf2 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Sat, 12 Sep 2015 09:51:11 -0700 Subject: [PATCH] Fix match for string-quoted identifier The pattern added in 785307ee only matches single-character identifiers, but should match identifiers of any non-zero length. Fix it. Signed-off-by: Kevin Locke --- 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 ca966ea..7b46d76 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -323,7 +323,7 @@ // MySQL supports strings as names, PostgreSQL needs identifiers. // Limit to after closing parenthesis to reduce false-positives // Currently only an issue for nextgen-gallery plugin - $pattern = '/\) AS \'([^\'])\'/'; + $pattern = '/\) AS \'([^\']+)\'/'; $sql = preg_replace( $pattern, ') AS "$1"', $sql); } // SELECT elseif( 0 === strpos($sql, 'UPDATE'))