com php-src: Merge branch 'PHP-5.5' into PHP-5.6: NEWS ext/pgsql/pgsql.c
| From: | Xinchen Hui | Date: | Sat, 14 Feb 2015 14:18:13 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.5' into PHP-5.6: NEWS ext/pgsql/pgsql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84886@lists.php.net to get a copy of this message | ||
Commit: 1db720cd6d63f5feafb5c7ecc5fada35e2189cff
Author: Xinchen Hui <laruence@php.net> Sat, 14 Feb 2015 22:18:13 +0800
Parents: d0be36cf5b5b92bd51e8e4c3e924411c93f95bd8 7667f8efc6ee9727cbd7af26e5f62f9cebd8a25e
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1db720cd6d63f5feafb5c7ecc5fada35e2189cff
Log:
Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
ext/pgsql/pgsql.c
Changed paths:
MM NEWS
MM ext/pgsql/pgsql.c
Diff:
diff --cc NEWS
index 28335d9,a0ffd3e..c75ad95
--- a/NEWS
+++ b/NEWS
@@@ -12,7 -14,14 +12,11 @@@
. Fix bug #61285, #68329, #68046, #41631: encrypted streams don't observe
socket timeouts (Brad Broerman)
+ - pgsql:
+ . Fixed bug #68638 (pg_update() fails to store infinite values).
+ (william dot welter at 4linux dot com dot br, Laruence)
+
-- CGI:
- . Fixed bug #69015 (php-cgi's getopt does not see $argv). (Laruence)
-
-?? ??? 2015, PHP 5.5.22
+?? Feb 2015, PHP 5.6.6
- Core:
. Removed support for multi-line headers, as the are deprecated by RFC 7230.
diff --cc ext/pgsql/pgsql.c
index ed7bf0b,2f12fd1..4bc20bc
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@@ -5966,12 -5600,17 +5963,17 @@@ PHP_PGSQL_API int php_pgsql_convert(PGc
switch (Z_TYPE_PP(val)) {
case IS_STRING:
if (Z_STRLEN_PP(val) == 0) {
- ZVAL_STRING(new_val, "NULL", 1);
+ ZVAL_STRINGL(new_val, "NULL", sizeof("NULL")-1, 1);
}
else {
- /* FIXME: better regex must be used */
- if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val),
"^([+-]{0,1}[0-9]+)|([+-]{0,1}[0-9]*[\\.][0-9]+)|([+-]{0,1}[0-9]+[\\.][0-9]*)$", 0
TSRMLS_CC) == FAILURE) {
+ /* better regex? */
+ if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val),
"^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$", 0 TSRMLS_CC) == FAILURE) {
- err = 1;
+ if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val),
"^[+-]{0,1}(inf)(inity){0,1}$", 1 TSRMLS_CC) == FAILURE) {
+ err = 1;
+ } else {
+ ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);
+ php_pgsql_add_quotes(new_val, 1 TSRMLS_CC);
+ }
}
else {
ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);