diff options
author | Xinchen Hui <laruence@php.net> | 2015-02-14 22:18:13 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-02-14 22:18:13 +0800 |
commit | 1db720cd6d63f5feafb5c7ecc5fada35e2189cff (patch) | |
tree | 9bef2c709247afce99204bd553f588aaed335e46 /ext/pgsql/pgsql.c | |
parent | d0be36cf5b5b92bd51e8e4c3e924411c93f95bd8 (diff) | |
parent | 7667f8efc6ee9727cbd7af26e5f62f9cebd8a25e (diff) | |
download | php-git-1db720cd6d63f5feafb5c7ecc5fada35e2189cff.tar.gz |
Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
ext/pgsql/pgsql.c
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r-- | ext/pgsql/pgsql.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index ed7bf0b610..4bc20bc142 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -5722,9 +5722,6 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char * regerr = regexec(&re, str, re.re_nsub+1, subs, 0); if (regerr == REG_NOMATCH) { -#ifdef PHP_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with '%s'", str, regex); -#endif ret = FAILURE; } else if (regerr) { @@ -5971,7 +5968,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con else { /* 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); |