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 <kevin@kevinlocke.name>
This commit is contained in:
Kevin Locke
2015-09-12 09:51:11 -07:00
parent 42c63a916f
commit b9479d4559

View File

@ -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'))