From: Xinchen Hui Date: Sat, 16 Apr 2016 04:29:27 +0000 (-0700) Subject: Fixed bug #72028 (pg_query_params(): NULL converts to empty string) X-Git-Tag: php-7.0.7RC1~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e01c518b6a504846f397b787ab285105531d562;p=php Fixed bug #72028 (pg_query_params(): NULL converts to empty string) I don't have a pgsql server by hand, so no test script, but the fix must be right. --- diff --git a/NEWS b/NEWS index 20821fe0c0..493c6361d3 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS leads to fatal error). (Laruence) - Postgres: + . Fixed bug #72028 (pg_query_params(): NULL converts to empty string). + (Laruence) . Fixed bug #71062 (pg_convert() doesn't accept ISO 8601 for datatype timestamp). (denver at timothy dot io) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 84a443e1b0..c22a23eb02 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1968,7 +1968,7 @@ PHP_FUNCTION(pg_query_params) params = (char **)safe_emalloc(sizeof(char *), num_params, 0); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) { - + ZVAL_DEREF(tmp); if (Z_TYPE_P(tmp) == IS_NULL) { params[i] = NULL; } else {