SEPARATE_ZVAL(current);
convert_to_string_ex(current);
- if (zend_hash_get_current_key(u_post, &string_key, &num_key) == HASH_KEY_IS_LONG) {
+ if (zend_hash_get_current_key(u_post, &string_key, &num_key, 0) == HASH_KEY_IS_LONG) {
php_error(E_WARNING, "Array passed to %s() must be an associative array", get_active_function_name());
RETURN_FALSE;
}
sprintf(str, "%s=%s", string_key, val_str);
ret = curl_formparse(str, &first, &last);
-
- efree(string_key);
+
efree(val_str);
}
objrec = malloc(1);
*objrec = '\0';
for(i=0; i<count; i++) {
- keytype = zend_hash_get_current_key(lht, &key, &length);
+ keytype = zend_hash_get_current_key(lht, &key, &length, 0);
/* if(HASH_KEY_IS_STRING == keytype) { */
zend_hash_get_current_data(lht, (void **) &keydataptr);
keydata = *keydataptr;
break;
}
}
- if(HASH_KEY_IS_STRING == keytype) efree(key);
objrec = realloc(objrec, strlen(objrec)+strlen(str)+1);
strcat(objrec, str);
/* } */
int j, noinsert=1;
ulong ind;
- zend_hash_get_current_key(newobjarr, &key, &ind);
+ zend_hash_get_current_key(newobjarr, &key, &ind, 0);
zend_hash_get_current_data(newobjarr, (void *) &dataptr);
data = *dataptr;
switch(data->type) {
modification = fnInsStr(modification, 0, "rem ");
}
}
- efree(key);
zend_hash_move_forward(newobjarr);
}
efree(oldobjrec);
int noinsert=1;
ulong ind;
- zend_hash_get_current_key(addobjarr, &key, &ind);
+ zend_hash_get_current_key(addobjarr, &key, &ind, 0);
zend_hash_get_current_data(addobjarr, (void *) &dataptr);
data = *dataptr;
switch(data->type) {
modification = fnInsStr(modification, 0, "\\");
modification = fnInsStr(modification, 0, addattribute);
}
- efree(key);
zend_hash_move_forward(addobjarr);
}
}
int noinsert=1;
ulong ind;
- zend_hash_get_current_key(remobjarr, &key, &ind);
+ zend_hash_get_current_key(remobjarr, &key, &ind, 0);
zend_hash_get_current_data(remobjarr, (void *) &dataptr);
data = *dataptr;
switch(data->type) {
modification = fnInsStr(modification, 0, "\\");
modification = fnInsStr(modification, 0, remattribute);
}
- efree(key);
zend_hash_move_forward(remobjarr);
}
}
zval *data, **dataptr;
ulong ind;
- zend_hash_get_current_key(prefixarray, &key, &ind);
+ zend_hash_get_current_key(prefixarray, &key, &ind, 0);
zend_hash_get_current_data(prefixarray, (void *) &dataptr);
data = *dataptr;
if (data->type != IS_STRING) {
php_error(E_WARNING,"%s is not a valid urlprefix", key);
RETURN_FALSE;
}
- efree(key);
zend_hash_move_forward(prefixarray);
}
} else {
zval *data, **dataptr;
ulong ind;
- zend_hash_get_current_key(prefixarray, &key, &ind);
+ zend_hash_get_current_key(prefixarray, &key, &ind, 0);
zend_hash_get_current_data(prefixarray, (void *) &dataptr);
data = *dataptr;
if (data->type != IS_STRING) {
php_error(E_WARNING,"%s is not a valid urlprefix", key);
RETURN_FALSE;
}
- efree(key);
zend_hash_move_forward(prefixarray);
}
} else {
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(body));
zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) &data);
- zend_hash_get_current_key(Z_ARRVAL_PP(body), &key, &ind);
+ zend_hash_get_current_key(Z_ARRVAL_PP(body), &key, &ind, 0); /* FIXME: is this necessary? we're not using key/ind */
if (Z_TYPE_PP(data) == IS_ARRAY) {
bod=mail_newbody();
zend_hash_move_forward(Z_ARRVAL_PP(body));
while(zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) &data) == SUCCESS) {
- zend_hash_get_current_key(Z_ARRVAL_PP(body), &key, &ind);
+ zend_hash_get_current_key(Z_ARRVAL_PP(body), &key, &ind, 0); /* FIXME: Is this necessary? We're not using key/ind */
if (Z_TYPE_PP(data) == IS_ARRAY) {
if (!toppart) {
bod->nested.part=mail_newbody_part();
while(zend_hash_get_current_data(arg->value.ht, (void**)&value) == SUCCESS) {
jval = _java_makeObject(*value JG_CC);
- switch (zend_hash_get_current_key(arg->value.ht, &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(arg->value.ht, &string_key, &num_key, 0)) {
case HASH_KEY_IS_STRING:
key.type = IS_STRING;
key.value.str.val = string_key;
key.value.str.len = strlen(string_key);
jkey = _java_makeObject(&key JG_CC);
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
key.type = IS_LONG;
ldap_mods[i] = emalloc(sizeof(LDAPMod));
ldap_mods[i]->mod_op = oper | LDAP_MOD_BVALUES;
- if (zend_hash_get_current_key((*entry)->value.ht,&attribute, &index) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key((*entry)->value.ht, &attribute, &index, 0) == HASH_KEY_IS_STRING) {
ldap_mods[i]->mod_type = estrdup(attribute);
- efree(attribute);
} else {
php_error(E_ERROR, "LDAP: Unknown Attribute in the data");
RETURN_FALSE;
}
for(i = 0; i < cursor->nparams; i++, zend_hash_move_forward(cursor->params)){
- if(zend_hash_get_current_key(cursor->params, ¶mname, NULL) != HASH_KEY_IS_STRING){
+ if(zend_hash_get_current_key(cursor->params, ¶mname, NULL, 0) != HASH_KEY_IS_STRING){
php_error(E_WARNING, "Can't get parameter name");
return 0;
}
if(zend_hash_get_current_data(cursor->params, (void **)¶m) == FAILURE){
php_error(E_WARNING, "Can't get parameter data");
- efree(paramname);
return 0;
}
if(isout){
SET_VAR_STRINGL(paramname, estrdup(param->progv), strlen(param->progv));
- efree(paramname);
continue;
}
(void **)&subject_entry) == SUCCESS) {
if ((result = php_replace_in_subject(*regex, *replace, subject_entry, &result_len, limit_val)) != NULL) {
/* Add to return array */
- switch(zend_hash_get_current_key((*subject)->value.ht, &string_key, &num_key))
+ switch(zend_hash_get_current_key((*subject)->value.ht, &string_key, &num_key, 0))
{
case HASH_KEY_IS_STRING:
add_assoc_stringl(return_value, string_key, result, result_len, 0);
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
(*entry)->refcount++;
/* Add to return array */
- switch(zend_hash_get_current_key((*input)->value.ht, &string_key, &num_key))
+ switch(zend_hash_get_current_key((*input)->value.ht, &string_key, &num_key, 0))
{
case HASH_KEY_IS_STRING:
zend_hash_update(return_value->value.ht, string_key,
strlen(string_key)+1, entry, sizeof(zval *), NULL);
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
parmlength += 1;
}
- switch (zend_hash_get_current_key(target_hash, &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(target_hash, &string_key, &num_key, 0)) {
case HASH_KEY_IS_STRING:
strcpy(parmlist + parmlength, string_key);
parmlength += strlen(string_key);
- efree(string_key);
-
break;
case HASH_KEY_IS_LONG:
}
pval_arg->type = IS_DOUBLE;
break;
+ case VT_DECIMAL:
+ switch (VarR8FromDec(&var_arg->decVal, &pval_arg->value.dval)) {
+ case DISP_E_OVERFLOW:
+ php_error(E_WARNING, "Overflow converting DECIMAL value to PHP floating point - number truncated");
+ pval_arg->value.dval = DBL_MAX;
+ /* break missing intentionally */
+ case S_OK:
+ pval_arg->type = IS_DOUBLE;
+ break;
+ default:
+ php_error(E_WARNING, "Error converting DECIMAL value to PHP floating point");
+ break;
+ }
+ break;
case VT_BOOL:
if (pval_arg->is_ref == 0 || (var_arg->vt & VT_BYREF) != VT_BYREF) {
if (var_arg->boolVal & 0xFFFF) {
}
pval_arg->type = IS_BOOL;
break;
+ case VT_VOID:
+ pval_arg->type = IS_NULL;
+ break;
case VT_BSTR:
if (pval_arg->is_ref == 0 || (var_arg->vt & VT_BYREF) != VT_BYREF) {
pval_arg->value.str.val = php_OLECHAR_to_char(var_arg->bstrVal, &pval_arg->value.str.len, persistent);
break;
case VT_UNKNOWN:
var_arg->pdispVal->lpVtbl->Release(var_arg->pdispVal);
- /* fallthru */
+ /* break missing intentionally */
default:
php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", var_arg->vt, var_arg->vt);
var_reset(pval_arg);
while(zend_hash_get_current_data(arg->value.ht, (void**)&value) == SUCCESS) {
jval = _java_makeObject(*value JG_CC);
- switch (zend_hash_get_current_key(arg->value.ht, &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(arg->value.ht, &string_key, &num_key, 0)) {
case HASH_KEY_IS_STRING:
key.type = IS_STRING;
key.value.str.val = string_key;
key.value.str.len = strlen(string_key);
jkey = _java_makeObject(&key JG_CC);
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
key.type = IS_LONG;
SEPARATE_ZVAL(indiv_handlers);
- if (zend_hash_get_current_key(handlers_list, &string_key, &num_key) == HASH_KEY_IS_LONG) {
+ if (zend_hash_get_current_key(handlers_list, &string_key, &num_key, 0) == HASH_KEY_IS_LONG) {
php_error(E_WARNING, "The Keys of the first dimension of your array must be strings");
RETURN_FALSE;
}
} else {
php_error(E_WARNING, "Invalid option: %s", string_key);
}
-
- S_FREE(string_key);
- }
+ }
}
/* }}} */
SEPARATE_ZVAL(value);
convert_to_string_ex(value);
- switch (zend_hash_get_current_key(php, &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(php, &string_key, &num_key, 1)) {
case HASH_KEY_IS_LONG:
sablot[i++] = Z_STRVAL_PP(value);
break;
#define ENCODE_LOOP(code) \
for (zend_hash_internal_pointer_reset(&PS(vars)); \
- zend_hash_get_current_key(&PS(vars), &key, &num_key) == HASH_KEY_IS_STRING; \
+ zend_hash_get_current_key(&PS(vars), &key, &num_key, 0) == HASH_KEY_IS_STRING; \
zend_hash_move_forward(&PS(vars))) { \
if (php_get_session_var(key, strlen(key), &struc PLS_CC PSLS_CC ELS_CC) == SUCCESS) { \
code; \
} \
- efree(key); \
}
static void php_set_session_var(char *name, size_t namelen,
char tmp[128];
ulong idx;
int hash_type;
- int dofree = 1;
int ret;
if (vallen == 0)
for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(retval));
zend_hash_get_current_data(Z_ARRVAL_P(retval), (void **) &ent) == SUCCESS;
zend_hash_move_forward(Z_ARRVAL_P(retval))) {
- hash_type = zend_hash_get_current_key(Z_ARRVAL_P(retval), &key, &idx);
+ hash_type = zend_hash_get_current_key(Z_ARRVAL_P(retval), &key, &idx, 0);
switch (hash_type) {
case HASH_KEY_IS_LONG:
sprintf(tmp, "%ld", idx);
key = tmp;
- dofree = 0;
/* fallthru */
case HASH_KEY_IS_STRING:
php_set_session_var(key, strlen(key), *ent PSLS_CC);
PS_ADD_VAR(key);
- if (dofree) efree(key);
- dofree = 1;
}
}
}
}
for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(PS(http_session_vars)));
- zend_hash_get_current_key(Z_ARRVAL_P(PS(http_session_vars)), &variable, &num_key) == HASH_KEY_IS_STRING;
+ zend_hash_get_current_key(Z_ARRVAL_P(PS(http_session_vars)), &variable, &num_key, 1) == HASH_KEY_IS_STRING;
zend_hash_move_forward(Z_ARRVAL_P(PS(http_session_vars)))) {
PS_ADD_VAR(variable);
}
PSLS_FETCH();
for (zend_hash_internal_pointer_reset(&PS(vars));
- zend_hash_get_current_key(&PS(vars), &variable, &num_key) == HASH_KEY_IS_STRING;
+ zend_hash_get_current_key(&PS(vars), &variable, &num_key, 0) == HASH_KEY_IS_STRING;
zend_hash_move_forward(&PS(vars))) {
if (zend_hash_find(&EG(symbol_table), variable, strlen(variable) + 1, (void **) &tmp)
== SUCCESS)
zend_hash_del(&EG(symbol_table), variable, strlen(variable) + 1);
- efree(variable);
}
/* Clean $HTTP_SESSION_VARS. */
php_error(E_WARNING, "Variable passed to key() is not an array or object");
RETURN_FALSE;
}
- switch (zend_hash_get_current_key(target_hash, &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(target_hash, &string_key, &num_key, 1)) {
case HASH_KEY_IS_STRING:
RETVAL_STRING(string_key, 0);
break;
/* Iterate through hash */
while(zend_hash_get_current_data(target_hash, (void **)&args[0]) == SUCCESS) {
/* Set up the key */
- if (zend_hash_get_current_key(target_hash, &string_key, &num_key) == HASH_KEY_IS_LONG) {
+ if (zend_hash_get_current_key(target_hash, &string_key, &num_key, 1) == HASH_KEY_IS_LONG) {
Z_TYPE_P(key) = IS_LONG;
Z_LVAL_P(key) = num_key;
} else {
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(var_array));
while(zend_hash_get_current_data(Z_ARRVAL_PP(var_array), (void **)&entry) == SUCCESS) {
- if (zend_hash_get_current_key(Z_ARRVAL_PP(var_array), &varname, &lkey) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key(Z_ARRVAL_PP(var_array), &varname, &lkey, 0) == HASH_KEY_IS_STRING) {
if (_valid_var_name(varname)) {
finalname = NULL;
efree(finalname);
}
}
-
- efree(varname);
}
zend_hash_move_forward(Z_ARRVAL_PP(var_array));
(*entry)->refcount++;
- switch (zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key, 0)) {
case HASH_KEY_IS_STRING:
zend_hash_update(Z_ARRVAL_P(return_value), string_key, strlen(string_key)+1,
entry, sizeof(zval *), NULL);
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
zend_hash_internal_pointer_reset(src);
while(zend_hash_get_current_data(src, (void **)&src_entry) == SUCCESS) {
- switch (zend_hash_get_current_key(src, &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(src, &string_key, &num_key, 0)) {
case HASH_KEY_IS_STRING:
if (recursive &&
zend_hash_find(dest, string_key, strlen(string_key) + 1,
zend_hash_update(dest, string_key, strlen(string_key)+1,
src_entry, sizeof(zval *), NULL);
}
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
if (add_key) {
MAKE_STD_ZVAL(new_val);
- switch (zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key, 1)) {
case HASH_KEY_IS_STRING:
Z_TYPE_P(new_val) = IS_STRING;
Z_STRVAL_P(new_val) = string_key;
while(zend_hash_get_current_data(Z_ARRVAL_PP(input), (void **)&entry) == SUCCESS) {
(*entry)->refcount++;
- switch (zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key, 0)) {
case HASH_KEY_IS_STRING:
zend_hash_update(Z_ARRVAL_P(return_value), string_key, strlen(string_key)+1,
entry, sizeof(zval *), NULL);
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
zend_hash_internal_pointer_reset(target_hash);
while (zend_hash_get_current_data(target_hash, (void **)&entry) == SUCCESS) {
MAKE_STD_ZVAL(data);
- switch (zend_hash_get_current_key(target_hash, &string_key, &num_key)) {
+ switch (zend_hash_get_current_key(target_hash, &string_key, &num_key, 1)) {
case HASH_KEY_IS_STRING:
Z_STRVAL_P(data) = string_key;
Z_STRLEN_P(data) = strlen(string_key);
/* We can't use zend_hash_index_find() because the array may have string keys or gaps. */
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(input));
- while (num_req_val && (key_type = zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key)) != HASH_KEY_NON_EXISTANT) {
+ while (num_req_val && (key_type = zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key, 0)) != HASH_KEY_NON_EXISTANT) {
#ifdef HAVE_LRAND48
randval = lrand48();
/* If we are returning a single result, just do it. */
if (Z_TYPE_P(return_value) != IS_ARRAY) {
if (key_type == HASH_KEY_IS_STRING) {
- RETURN_STRING(string_key, 0);
+ RETURN_STRING(string_key, 1);
} else {
RETURN_LONG(num_key);
}
} else {
/* Append the result to the return value. */
if (key_type == HASH_KEY_IS_STRING)
- add_next_index_string(return_value, string_key, 0);
+ add_next_index_string(return_value, string_key, 1);
else
add_next_index_long(return_value, num_key);
}
num_req_val--;
- } else if (key_type == HASH_KEY_IS_STRING)
- efree(string_key);
-
+ }
num_avail--;
zend_hash_move_forward(Z_ARRVAL_PP(input));
}
PUTS("<TD BGCOLOR=\"" PHP_ENTRY_NAME_COLOR "\"><B>");
PUTS(name);
PUTS("[\"");
- switch (zend_hash_get_current_key((*data)->value.ht, &string_key, &num_key)) {
+ switch (zend_hash_get_current_key((*data)->value.ht, &string_key, &num_key, 0)) {
case HASH_KEY_IS_STRING:
PUTS(string_key);
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
php_printf("%ld",num_key);
zend_hash_internal_pointer_reset_ex(hash, &hpos);
while (zend_hash_get_current_data_ex(hash, (void **)&entry, &hpos) == SUCCESS) {
- switch (zend_hash_get_current_key_ex(hash, &string_key, NULL, &num_key, &hpos)) {
+ switch (zend_hash_get_current_key_ex(hash, &string_key, NULL, &num_key, 0, &hpos)) {
case HASH_KEY_IS_STRING:
len = strlen(string_key);
if (len > maxlen) maxlen = len;
if (len < minlen) minlen = len;
- efree(string_key);
break;
case HASH_KEY_IS_LONG:
zend_hash_internal_pointer_reset_ex(HASH_OF(retval_ptr),&pos);
for (;; zend_hash_move_forward_ex(HASH_OF(retval_ptr),&pos)) {
- if ((i = zend_hash_get_current_key_ex(HASH_OF(retval_ptr), &key, NULL, &index, &pos)) == HASH_KEY_NON_EXISTANT) {
+ if ((i = zend_hash_get_current_key_ex(HASH_OF(retval_ptr), &key, NULL, &index, 0, &pos)) == HASH_KEY_NON_EXISTANT) {
break;
}
zend_hash_internal_pointer_reset_ex(myht, &pos);
for (;; zend_hash_move_forward_ex(myht, &pos)) {
- if ((i = zend_hash_get_current_key_ex(myht, &key, NULL, &index, &pos)) == HASH_KEY_NON_EXISTANT) {
+ if ((i = zend_hash_get_current_key_ex(myht, &key, NULL, &index, 0, &pos)) == HASH_KEY_NON_EXISTANT) {
break;
}
if (zend_hash_get_current_data_ex(myht, (void **) (&data), &pos) != SUCCESS || !data /* || ((*data) == (*struc)) */) {
- if (i == HASH_KEY_IS_STRING)
- efree(key);
continue;
}
if (*ent == obj)
continue;
- if (zend_hash_get_current_key(HASH_OF(obj), &key, &idx) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key(HASH_OF(obj), &key, &idx, 0) == HASH_KEY_IS_STRING) {
php_wddx_serialize_var(packet, *ent, key);
- efree(key);
} else {
sprintf(tmp_buf, "%ld", idx);
php_wddx_serialize_var(packet, *ent, tmp_buf);
zend_hash_get_current_data(target_hash, (void**)&ent) == SUCCESS;
zend_hash_move_forward(target_hash)) {
- type = zend_hash_get_current_key(target_hash, &key, &idx);
+ type = zend_hash_get_current_key(target_hash, &key, &idx, 0);
if (type == HASH_KEY_IS_STRING) {
is_struct = 1;
- efree(key);
break;
}
continue;
if (is_struct) {
- ent_type = zend_hash_get_current_key(target_hash, &key, &idx);
+ ent_type = zend_hash_get_current_key(target_hash, &key, &idx, 0);
if (ent_type == HASH_KEY_IS_STRING) {
php_wddx_serialize_var(packet, *ent, key);
- efree(key);
} else {
sprintf(tmp_buf, "%ld", idx);
php_wddx_serialize_var(packet, *ent, tmp_buf);
fprintf(stderr, "Merge dir (%p) (%p)\n", base_conf, new_conf);
for (zend_hash_internal_pointer_reset(&d->config);
- zend_hash_get_current_key_ex(&d->config, &str, &str_len, &num_index, NULL) == HASH_KEY_IS_STRING;
+ zend_hash_get_current_key_ex(&d->config, &str, &str_len, &num_index, 0, NULL) == HASH_KEY_IS_STRING;
zend_hash_move_forward(&d->config)) {
pe = NULL;
zend_hash_get_current_data(&d->config, (void **) &data);
php_dir_entry *data;
for (zend_hash_internal_pointer_reset(&d->config);
- zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, NULL) == HASH_KEY_IS_STRING;
+ zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, 0, NULL) == HASH_KEY_IS_STRING;
zend_hash_move_forward(&d->config)) {
zend_hash_get_current_data(&d->config, (void **) &data);
fprintf(stderr, "APPLYING (%s)(%s)\n", str, data->value);