From: Ilia Alshanetsky Date: Mon, 3 Sep 2007 15:36:04 +0000 (+0000) Subject: Fixed bug #42506 (php_pgsql_convert() timezone parse bug) X-Git-Tag: php-5.2.5RC1~225 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59a410cb7609249c1a7c88d04d3ef2c45cf6b639;p=php Fixed bug #42506 (php_pgsql_convert() timezone parse bug) --- diff --git a/NEWS b/NEWS index 9264a18bf1..3b10039cf2 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ PHP NEWS - Fixed bug #42512 (ip2long('255.255.255.255') should return 4294967295 on 64-bit PHP). (Derick) +- Fixed bug #42506 (php_pgsql_convert() timezone parse bug) (nonunnet at + gmail dot com, Ilia) - Fixed bug #42462 (Segmentation when trying to set an attribute in a DOMElement). (Rob) - Fixed bug #42453 (CGI SAPI does not shut down cleanly with -i/-m/-v cmdline diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 508011617a..eedcf84ccd 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -5001,7 +5001,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con ZVAL_STRINGL(new_val, "NOW()", sizeof("NOW()")-1, 1); } else { /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[a-zA-Z]{1,5})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) { err = 1; } else { ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);