summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2014-02-16 06:25:01 +0900
committerYasuo Ohgaki <yohgaki@php.net>2014-02-16 06:25:01 +0900
commit8c9fd8fb534babc4b6fb0eee00dddb080cde83d7 (patch)
treeb01f642de1d811e7307226b02438b148df3fc9d3
parenta65a54664066b69663d51726c64d3ff0e940f5c4 (diff)
parent9f251548ae4875aa7714e81c79668cc231d7de6c (diff)
downloadphp-git-8c9fd8fb534babc4b6fb0eee00dddb080cde83d7.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Revise encoding blacklist
-rw-r--r--ext/pgsql/pgsql.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 97f61db860..2a8c83201e 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -794,18 +794,17 @@ static char* php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t le
char *encoding;
/* This is compatible with PQescapeLiteral, but it cannot handle multbyte chars
such as SJIS, BIG5. Raise warning and return NULL by checking
- client_encoding. XXX: Black list could be wrong. False positive. */
+ client_encoding. */
encoding = (char *) pg_encoding_to_char(PQclientEncoding(conn));
if (!strncmp(encoding, "SJIS", sizeof("SJIS")-1) ||
!strncmp(encoding, "SHIFT_JIS_2004", sizeof("SHIFT_JIS_2004")-1) ||
- !strncmp(encoding, "WIN874", sizeof("WIN874")-1) ||
- !strncmp(encoding, "WIN1258", sizeof("WIN1258")-1) ||
!strncmp(encoding, "BIG5", sizeof("BIG5")-1) ||
+ !strncmp(encoding, "GB18030", sizeof("GB18030")-1) ||
!strncmp(encoding, "GBK", sizeof("GBK")-1) ||
!strncmp(encoding, "JOHAB", sizeof("JOHAB")-1) ||
!strncmp(encoding, "UHC", sizeof("UHC")-1) ) {
TSRMLS_FETCH();
-
+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsafe encoding is used. Do not use '%s' encoding or use PostgreSQL 9.0 or later libpq.", encoding);
}
/* check backslashes */