diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2006-11-13 22:11:02 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2006-11-13 22:11:02 +0000 |
| commit | cae55a69eb6d7681538920ca13d92f9fc8d51125 (patch) | |
| tree | 607d2250be239c7b3bc3e7bca63e69b5e27ae13e /ext | |
| parent | b4f3ce372d191f60e957e4b950733536cae16f42 (diff) | |
| download | php-git-cae55a69eb6d7681538920ca13d92f9fc8d51125.tar.gz | |
MFB: Fixed bug #36812 (pg_execute() modifies input array).
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/pgsql/pgsql.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 65b6579929..f8dfbcea9e 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1472,6 +1472,7 @@ PHP_FUNCTION(pg_execute) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first"); } + SEPARATE_ZVAL(pv_param_arr); zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr)); if (num_params > 0) { @@ -1486,7 +1487,8 @@ PHP_FUNCTION(pg_execute) } otype = (*tmp)->type; - convert_to_string(*tmp); + SEPARATE_ZVAL(tmp); + convert_to_string_ex(tmp); if (Z_TYPE_PP(tmp) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter"); _php_pgsql_free_params(params, num_params); @@ -1495,8 +1497,7 @@ PHP_FUNCTION(pg_execute) if (otype == IS_NULL) { params[i] = NULL; - } - else { + } else { params[i] = Z_STRVAL_PP(tmp); } |
