From: Felipe Pena Date: Tue, 20 Apr 2010 11:49:23 +0000 (+0000) Subject: - Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string literal) X-Git-Tag: php-5.2.14RC1~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d150a2a0b106e8d7490aaab045bff5c9fa96f00a;p=php - Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string literal) Patch by: cbandy at jbandy dot com --- diff --git a/NEWS b/NEWS index 499d1fe673..07f1ea2230 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ PHP NEWS - Fixed a NULL pointer dereference when processing invalid XML-RPC requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert) +- Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string + literal). (cbandy at jbandy dot com) - Fixed bug #51445 (var_dump() invalid/slow *RECURSION* detection). (Felipe) - Fixed bug #51393 (DateTime::createFromFormat() fails if format string contains timezone). (Adam) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 6579a96d62..042f81ff77 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3342,9 +3342,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))) {