iliaa Wed Aug 22 22:40:29 2007 UTC Modified files: (Branch: PHP_5_2) /php-src NEWS /php-src/ext/pgsql pgsql.c Log: Fixed bug #42368 (Incorrect error message displayed by pg_escape_string). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.905&r2=1.2027.2.547.2.906&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.905 php-src/NEWS:1.2027.2.547.2.906 --- php-src/NEWS:1.2027.2.547.2.905 Wed Aug 22 14:59:45 2007 +++ php-src/NEWS Wed Aug 22 22:40:29 2007 @@ -1,8 +1,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Aug 2007, PHP 5.2.4 +- Fixed bug #42368 (Incorrect error message displayed by pg_escape_string). + (Ilia) - Fixed bug #42365 (glob() crashes and/or accepts way too many flags). (Jani) -- Fixed bug #42183 (classmap cause crashr in non-wsdl mode). (Dmitry) +- Fixed bug #42183 (classmap causes crash in non-wsdl mode). (Dmitry) - Fixed bug #42009 (is_a() and is_subclass_of() should NOT call autoload, in the same way as "instanceof" operator). (Dmitry) - Fixed bug #41904 (proc_open(): empty env array should cause empty http://cvs.php.net/viewvc.cgi/php-src/ext/pgsql/pgsql.c?r1=1.331.2.13.2.21&r2=1.331.2.13.2.22&diff_format=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.331.2.13.2.21 php-src/ext/pgsql/pgsql.c:1.331.2.13.2.22 --- php-src/ext/pgsql/pgsql.c:1.331.2.13.2.21 Mon Jul 2 15:37:43 2007 +++ php-src/ext/pgsql/pgsql.c Wed Aug 22 22:40:29 2007 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.331.2.13.2.21 2007/07/02 15:37:43 iliaa Exp $ */ +/* $Id: pgsql.c,v 1.331.2.13.2.22 2007/08/22 22:40:29 iliaa Exp $ */ #include <stdlib.h> @@ -3571,11 +3571,20 @@ int from_len; int id = -1; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == SUCCESS) { - pgsql_link = NULL; - id = PGG(default_link); - } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) { - return; + switch (ZEND_NUM_ARGS()) { + case 1: + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) { + return; + } + pgsql_link = NULL; + id = PGG(default_link); + break; + + default: + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) { + return; + } + break; } to = (char *) safe_emalloc(from_len, 2, 1); @@ -3604,11 +3613,20 @@ #endif zval *pgsql_link; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == SUCCESS) { - pgsql_link = NULL; - id = PGG(default_link); - } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) { - return; + switch (ZEND_NUM_ARGS()) { + case 1: + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) { + return; + } + pgsql_link = NULL; + id = PGG(default_link); + break; + + default: + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) { + return; + } + break; } #ifdef HAVE_PQESCAPE_BYTEA_CONN
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php