mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
only rewrite tmp if quoter returns true
This commit is contained in:
parent
636cc3e1dc
commit
2e36e9d06d
1 changed files with 7 additions and 6 deletions
|
@ -244,7 +244,6 @@ static PHP_METHOD(PDOStatement, execute)
|
||||||
while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(input_params), (void*)&tmp)) {
|
while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(input_params), (void*)&tmp)) {
|
||||||
char *quotedstr;
|
char *quotedstr;
|
||||||
int quotedstrlen;
|
int quotedstrlen;
|
||||||
int refcount;
|
|
||||||
memset(¶m, 0, sizeof(param));
|
memset(¶m, 0, sizeof(param));
|
||||||
|
|
||||||
if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(input_params),
|
if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(input_params),
|
||||||
|
@ -266,11 +265,13 @@ static PHP_METHOD(PDOStatement, execute)
|
||||||
}
|
}
|
||||||
|
|
||||||
param.param_type = PDO_PARAM_STR;
|
param.param_type = PDO_PARAM_STR;
|
||||||
stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), "edstr, "edstrlen TSRMLS_DC);
|
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp),
|
||||||
refcount = (*tmp)->refcount;
|
"edstr, "edstrlen TSRMLS_DC)) {
|
||||||
|
int refcount = (*tmp)->refcount;
|
||||||
zval_dtor(*tmp);
|
zval_dtor(*tmp);
|
||||||
ZVAL_STRINGL(*tmp, quotedstr, quotedstrlen, 0);
|
ZVAL_STRINGL(*tmp, quotedstr, quotedstrlen, 0);
|
||||||
(*tmp)->refcount = refcount;
|
(*tmp)->refcount = refcount;
|
||||||
|
}
|
||||||
param.parameter = *tmp;
|
param.parameter = *tmp;
|
||||||
|
|
||||||
if (!really_register_bound_param(¶m, stmt, 1 TSRMLS_CC)) {
|
if (!really_register_bound_param(¶m, stmt, 1 TSRMLS_CC)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue