mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed Hash API usage
This commit is contained in:
parent
4ababc3a41
commit
af3829608d
1 changed files with 5 additions and 4 deletions
|
@ -780,8 +780,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
|
|||
padding = 3;
|
||||
}
|
||||
if(params) {
|
||||
HashPosition *param_pos;
|
||||
zend_hash_internal_pointer_reset(params);
|
||||
while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) {
|
||||
while ((param == zend_hash_get_current_data_ptr_ex(params, ¶m_pos)) != NULL) {
|
||||
if(param->parameter) {
|
||||
convert_to_string(param->parameter);
|
||||
/* accommodate a string that needs to be fully quoted
|
||||
|
@ -813,9 +814,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
|
|||
}
|
||||
/* lookup bind first via hash and then index */
|
||||
/* stupid keys need to be null-terminated, even though we know their length */
|
||||
if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok,(void **)¶m))
|
||||
if((NULL != (param = zend_hash_str_find_ptr(params, s.tok, s.cur-s.tok))
|
||||
||
|
||||
(SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m)))
|
||||
NULL != (params = zend_hash_index_find_ptr(params, bindno)))
|
||||
{
|
||||
char *quotedstr;
|
||||
int quotedstrlen;
|
||||
|
@ -852,7 +853,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
|
|||
return (int) (s.cur - inquery);
|
||||
}
|
||||
/* lookup bind by index */
|
||||
if(SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m))
|
||||
if(NULL != zend_hash_index_find(params, bindno, (void **)¶m))
|
||||
{
|
||||
char *quotedstr;
|
||||
int quotedstrlen;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue