Skip to content

Commit 7e01c51

Browse files
committed
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.
1 parent 05d53de commit 7e01c51

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ PHP NEWS
1111
leads to fatal error). (Laruence)
1212

1313
- Postgres:
14+
. Fixed bug #72028 (pg_query_params(): NULL converts to empty string).
15+
(Laruence)
1416
. Fixed bug #71062 (pg_convert() doesn't accept ISO 8601 for datatype
1517
timestamp). (denver at timothy dot io)
1618

ext/pgsql/pgsql.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,7 @@ PHP_FUNCTION(pg_query_params)
19681968
params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
19691969

19701970
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) {
1971-
1971+
ZVAL_DEREF(tmp);
19721972
if (Z_TYPE_P(tmp) == IS_NULL) {
19731973
params[i] = NULL;
19741974
} else {

0 commit comments

Comments
 (0)