diff options
| author | William Felipe Welter <william.welter@4linux.com.br> | 2015-02-09 20:35:18 -0200 |
|---|---|---|
| committer | William Felipe Welter <william.welter@4linux.com.br> | 2015-02-09 20:35:18 -0200 |
| commit | 60d5cdf1379950afde23de10acc964e7fc34145b (patch) | |
| tree | 42a4cf700d9beb1603d978c6f48d946b335ce8a1 | |
| parent | bb3a81c4b482e94354fed40d0f1e1f81afca7437 (diff) | |
| download | php-git-60d5cdf1379950afde23de10acc964e7fc34145b.tar.gz | |
Fixed bug #68638 pg_update() fails to store infinite values
Check if value is "infinity" with strcasestr() to add quotes
| -rw-r--r-- | ext/pgsql/pgsql.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index f4595c7503..d8c99f2d09 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; |
