mirror of
https://github.com/PostgreSQL-For-Wordpress/postgresql-for-wordpress.git
synced 2025-07-30 17:57:13 +02:00
Moved the quoting hacks for PostgreSQL 9.1+ compatibility so that they apply to all queries
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546507 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
@ -280,10 +280,6 @@
|
||||
// WP 2.6.1 => 2.8 upgrade, removes a PostgreSQL error but there are some remaining
|
||||
$sql = str_replace( "post_date = '0000-00-00 00:00:00'", "post_date IS NULL", $sql);
|
||||
|
||||
// Correct quoting for PostgreSQL 9.1+ compatibility
|
||||
$sql = str_replace( "\\'", "''", $sql);
|
||||
$sql = str_replace( '\"', '"', $sql);
|
||||
|
||||
// This will avoid modifications to anything following ' SET '
|
||||
list($sql,$end) = explode( ' SET ', $sql, 2);
|
||||
$end = ' SET '.$end;
|
||||
@ -329,10 +325,6 @@
|
||||
if( preg_match('/^.{1}/us',$sql,$ar) != 1)
|
||||
$sql = utf8_encode($sql);
|
||||
|
||||
// Correct quoting for PostgreSQL 9.1+ compatibility
|
||||
$sql = str_replace( "\\'", "''", $sql);
|
||||
$sql = str_replace( '\"', '"', $sql);
|
||||
|
||||
// This will avoid modifications to anything following ' VALUES'
|
||||
list($sql,$end) = explode( ' VALUES', $sql, 2);
|
||||
$end = ' VALUES'.$end;
|
||||
@ -439,6 +431,10 @@
|
||||
// Put back the end of the query if it was separated
|
||||
$sql .= $end;
|
||||
|
||||
// Correct quoting for PostgreSQL 9.1+ compatibility
|
||||
$sql = str_replace( "\\'", "''", $sql);
|
||||
$sql = str_replace( '\"', '"', $sql);
|
||||
|
||||
if( PG4WP_DEBUG)
|
||||
{
|
||||
if( $initial != $sql)
|
||||
|
Reference in New Issue
Block a user