com php-src: Fixed bug #68638 pg_update() fails to store infinite values Check if value is "infini ty" with strcasestr() to add quotes: ext/pg
sql/pgsql.c
| From: | Xinchen Hui | Date: | Mon, 09 Feb 2015 22:35:18 +0000 |
| Subject: | com php-src: Fixed bug #68638 pg_update() fails to store infinite values Check if value is "infini ty" with strcasestr() to add quotes: ext/pg sql/pgsql.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84879@lists.php.net to get a copy of this message | ||
Commit: 60d5cdf1379950afde23de10acc964e7fc34145b
Author: William Felipe Welter <william.welter@4linux.com.br> Mon, 9 Feb 2015
20:35:18 -0200
Parents: bb3a81c4b482e94354fed40d0f1e1f81afca7437
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=60d5cdf1379950afde23de10acc964e7fc34145b
Log:
Fixed bug #68638 pg_update() fails to store infinite values
Check if value is "infinity" with strcasestr() to add quotes
Bugs:
https://bugs.php.net/68638
Changed paths:
M ext/pgsql/pgsql.c
Diff:
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index f4595c7..d8c99f2 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -5591,15 +5591,13 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name,
con
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,1}(inf)(inity){0,1})$",
1 TSRMLS_CC) == FAILURE) {
- err = 1;
+ err = 1;
}
else {
-
ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);
- if(php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val),
"^([+-]{0,1}(inf)(inity){0,1})$", 1 TSRMLS_CC) == SUCCESS) {
+ if(strcasestr(Z_STRVAL_PP(val),"inf")!=0){
php_pgsql_add_quotes(new_val, 1 TSRMLS_CC);
}
-
}
}
break;