From 7e01c518b6a504846f397b787ab285105531d562 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 15 Apr 2016 21:29:27 -0700 Subject: [PATCH] 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. --- NEWS | 2 ++ ext/pgsql/pgsql.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.40.0