From: Mark A. Hershberger Date: Tue, 11 Oct 2011 20:49:28 +0000 (+0000) Subject: Avoid warnings from PG about improper escaping. X-Git-Tag: 1.31.0-rc.0~27138 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=6b9085255cc7815a6e35040fbd17a57a4beb7d91;p=lhc%2Fweb%2Fwiklou.git Avoid warnings from PG about improper escaping. See http://www.postgresql.org/docs/8.1/static/release-8-1.html --- diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index f0655b544e..1b0539c14b 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -766,8 +766,8 @@ class DatabasePostgres extends DatabaseBase { $q = <<query( sprintf( @@ -878,7 +878,11 @@ SQL; } elseif ( is_bool( $s ) ) { return intval( $s ); } elseif ( $s instanceof Blob ) { - return "'" . $s->fetch( $s ) . "'"; + $ret = "'" . $s->fetch( $s ) . "'"; + if ( $this->numeric_version >= 8.1 ) { + $ret = "E$ret"; + } + return $ret; } return "'" . pg_escape_string( $this->mConn, $s ) . "'"; }