From 0b401e12891fd9fe773d66add86f2c4093527b46 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Tue, 20 Apr 2010 11:49:23 +0000 Subject: [PATCH] - Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string literal) Patch by: cbandy at jbandy dot com --- NEWS | 2 ++ ext/pgsql/pgsql.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index bebc34f25ec..7ac9fb380e4 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,8 @@ PHP NEWS requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert) - Fixed 64-bit integer overflow in mhash_keygen_s2k(). (Clément LECIGNE, Stas) +- Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string + literal). (cbandy at jbandy dot com) - Fixed bug #51590 (JSON_ERROR_UTF8 is undefined). (Felipe) - Fixed bug #51577 (Uninitialized memory reference with oci_bind_array_by_name) (Oracle Corp.) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 43bd32b8f56..92725ee9965 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3765,9 +3765,9 @@ PHP_FUNCTION(pg_copy_to) } if (memchr(table_name, '.', table_name_len)) { - spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS '%c' WITH NULL AS '%s'", table_name, *pg_delim, pg_null_as); + spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as); } else { - spprintf(&query, 0, "COPY \"%s\" TO STDOUT DELIMITERS '%c' WITH NULL AS '%s'", table_name, *pg_delim, pg_null_as); + spprintf(&query, 0, "COPY \"%s\" TO STDOUT DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as); } while ((pgsql_result = PQgetResult(pgsql))) {