com php-src: Revise encoding blacklist: ext/pgsql/pgsql.c

From: Date: Sat, 15 Feb 2014 21:21:39 +0000
Subject: com php-src: Revise encoding blacklist: ext/pgsql/pgsql.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-76002@lists.php.net to get a copy of this message
Commit: 9f251548ae4875aa7714e81c79668cc231d7de6c Author: Yasuo Ohgaki <yohgaki@php.net> Sun, 16 Feb 2014 06:21:39 +0900 Parents: 9d84f6c06ec59e8fc23b715c08fba2eaf451868a Branches: PHP-5.4 PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9f251548ae4875aa7714e81c79668cc231d7de6c Log: Revise encoding blacklist Changed paths: M ext/pgsql/pgsql.c Diff: diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 270b7ba..1f0d630 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 */

« previous php.cvs (#76002) next »