php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #68638
Patch fix-accept-infinity-values revision 2015-02-04 00:18 UTC by william dot welter at 4linux dot com dot br

Patch fix-accept-infinity-values for PostgreSQL related Bug #68638

Patch version 2015-02-04 00:18 UTC

Return to Bug #68638 | Download this patch
Patch Revisions:

Developer: william.welter@4linux.com.br

diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 16ce7bf..e8070ac 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -5590,11 +5590,12 @@ 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 TSRMLS_CC) == FAILURE) {
+							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;
 							}
 							else {
 								ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);
+								php_pgsql_add_quotes(new_val, 1 TSRMLS_CC);
 							}
 						}
 						break;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 19:01:29 2024 UTC