summaryrefslogtreecommitdiff
path: root/ext/soap/php_encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r--ext/soap/php_encoding.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 1198eaf601..2da75a3e2e 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -283,16 +283,6 @@ static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type)
return NULL;
}
-static zval *soap_hash_str_find_deref(HashTable *ht, const char *str, size_t len) {
- zval *zv = zend_hash_str_find(ht, str, len);
- if (!zv) {
- return NULL;
- }
-
- ZVAL_DEREF(zv);
- return zv;
-}
-
static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
xmlNodePtr node_ptr;
@@ -402,14 +392,14 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
encodePtr enc = NULL;
HashTable *ht = Z_OBJPROP_P(data);
- if ((ztype = soap_hash_str_find_deref(ht, "enc_type", sizeof("enc_type")-1)) == NULL ||
+ if ((ztype = zend_hash_str_find_deref(ht, "enc_type", sizeof("enc_type")-1)) == NULL ||
Z_TYPE_P(ztype) != IS_LONG) {
soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property");
}
- if ((zstype = soap_hash_str_find_deref(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL &&
+ if ((zstype = zend_hash_str_find_deref(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL &&
Z_TYPE_P(zstype) == IS_STRING) {
- if ((zns = soap_hash_str_find_deref(ht, "enc_ns", sizeof("enc_ns")-1)) != NULL &&
+ if ((zns = zend_hash_str_find_deref(ht, "enc_ns", sizeof("enc_ns")-1)) != NULL &&
Z_TYPE_P(zns) == IS_STRING) {
enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_P(zns), Z_STRVAL_P(zstype));
} else {
@@ -436,13 +426,13 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
enc = encode;
}
- zdata = soap_hash_str_find_deref(ht, "enc_value", sizeof("enc_value")-1);
+ zdata = zend_hash_str_find_deref(ht, "enc_value", sizeof("enc_value")-1);
node = master_to_xml(enc, zdata, style, parent);
if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode != enc)) {
- if ((zstype = soap_hash_str_find_deref(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL &&
+ if ((zstype = zend_hash_str_find_deref(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL &&
Z_TYPE_P(zstype) == IS_STRING) {
- if ((zns = soap_hash_str_find_deref(ht, "enc_ns", sizeof("enc_ns")-1)) != NULL &&
+ if ((zns = zend_hash_str_find_deref(ht, "enc_ns", sizeof("enc_ns")-1)) != NULL &&
Z_TYPE_P(zns) == IS_STRING) {
set_ns_and_type_ex(node, Z_STRVAL_P(zns), Z_STRVAL_P(zstype));
} else {
@@ -451,11 +441,11 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
}
}
- if ((zname = soap_hash_str_find_deref(ht, "enc_name", sizeof("enc_name")-1)) != NULL &&
+ if ((zname = zend_hash_str_find_deref(ht, "enc_name", sizeof("enc_name")-1)) != NULL &&
Z_TYPE_P(zname) == IS_STRING) {
xmlNodeSetName(node, BAD_CAST(Z_STRVAL_P(zname)));
}
- if ((znamens = soap_hash_str_find_deref(ht, "enc_namens", sizeof("enc_namens")-1)) != NULL &&
+ if ((znamens = zend_hash_str_find_deref(ht, "enc_namens", sizeof("enc_namens")-1)) != NULL &&
Z_TYPE_P(znamens) == IS_STRING) {
xmlNsPtr nsp = encode_add_ns(node, Z_STRVAL_P(znamens));
xmlSetNs(node, nsp);
@@ -1214,7 +1204,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv)
ZVAL_DEREF(data);
return data;
} else if (Z_TYPE_P(object) == IS_ARRAY) {
- return soap_hash_str_find_deref(Z_ARRVAL_P(object), name, strlen(name));
+ return zend_hash_str_find_deref(Z_ARRVAL_P(object), name, strlen(name));
}
return NULL;
}
@@ -1430,7 +1420,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
zval *classname;
zend_class_entry *tmp;
- if ((classname = soap_hash_str_find_deref(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str))) != NULL &&
+ if ((classname = zend_hash_str_find_deref(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str))) != NULL &&
Z_TYPE_P(classname) == IS_STRING &&
(tmp = zend_fetch_class(Z_STR_P(classname), ZEND_FETCH_CLASS_AUTO)) != NULL) {
ce = tmp;
@@ -2913,7 +2903,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
#ifdef HAVE_TM_GMTOFF
snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 ));
#else
-# if defined(__CYGWIN__) || defined(NETWARE) || (defined(PHP_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1900)
+# if defined(__CYGWIN__) || (defined(PHP_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1900)
snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60));
# else
snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60));
@@ -3536,20 +3526,20 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type)
Z_OBJCE_P(tmp) == soap_var_class_entry) {
zval *ztype;
- if ((ztype = soap_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_type", sizeof("enc_type")-1)) == NULL ||
+ if ((ztype = zend_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_type", sizeof("enc_type")-1)) == NULL ||
Z_TYPE_P(ztype) != IS_LONG) {
soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property");
}
cur_type = Z_LVAL_P(ztype);
- if ((ztype = soap_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_stype", sizeof("enc_stype")-1)) != NULL &&
+ if ((ztype = zend_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_stype", sizeof("enc_stype")-1)) != NULL &&
Z_TYPE_P(ztype) == IS_STRING) {
cur_stype = Z_STRVAL_P(ztype);
} else {
cur_stype = NULL;
}
- if ((ztype = soap_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_ns", sizeof("enc_ns")-1)) != NULL &&
+ if ((ztype = zend_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_ns", sizeof("enc_ns")-1)) != NULL &&
Z_TYPE_P(ztype) == IS_STRING) {
cur_ns = Z_STRVAL_P(ztype);
} else {