Plugin Directory

Changeset 542038


Ignore:
Timestamp:
05/09/2012 08:17:16 PM (14 years ago)
Author:
hawk__
Message:

Added support for PostgreSQL 9.1+ default config for standard_conforming_strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postgresql-for-wordpress/trunk/pg4wp/driver_pgsql.php

    r458029 r542038  
    5353    function wpsql_fetch_assoc($result) { return pg_fetch_assoc($result); }
    5454    function wpsql_escape_string($s) { return pg_escape_string($s); }
     55    function wpsql_real_escape_string($s,$c) { return pg_escape_string($s); }
    5556    function wpsql_get_server_info() { return '5.0.30'; } // Just want to fool wordpress ...
    5657    function wpsql_result($result, $i, $fieldname)
     
    274275            $sql = str_replace( "post_date = '0000-00-00 00:00:00'", "post_date IS NULL", $sql);
    275276           
     277            // Correct quoting for PostgreSQL 9.1+ compatibility
     278            $sql = str_replace( "\\'", "''", $sql);
     279            $sql = str_replace( '\"', '"', $sql);
     280           
    276281            // This will avoid modifications to anything following ' SET '
    277282            list($sql,$end) = explode( ' SET ', $sql, 2);
     
    318323            if( preg_match('/^.{1}/us',$sql,$ar) != 1)
    319324                $sql = utf8_encode($sql);
     325           
     326            // Correct quoting for PostgreSQL 9.1+ compatibility
     327            $sql = str_replace( "\\'", "''", $sql);
     328            $sql = str_replace( '\"', '"', $sql);
    320329           
    321330            // This will avoid modifications to anything following ' VALUES'
Note: See TracChangeset for help on using the changeset viewer.