From 6b9085255cc7815a6e35040fbd17a57a4beb7d91 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Tue, 11 Oct 2011 20:49:28 +0000 Subject: [PATCH] Avoid warnings from PG about improper escaping. See http://www.postgresql.org/docs/8.1/static/release-8-1.html --- includes/db/DatabasePostgres.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 ) . "'"; } -- 2.20.1