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.c139
1 files changed, 68 insertions, 71 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 97b619d359..d34587b85e 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -145,7 +145,7 @@ encode defaultEncoding[] = {
{{IS_NULL, "nil", XSI_NAMESPACE, NULL}, to_zval_null, to_xml_null},
{{IS_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string},
- {{IS_INT, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
+ {{IS_LONG, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long},
{{IS_DOUBLE, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double},
{{IS_FALSE, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool},
{{IS_TRUE, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool},
@@ -290,7 +290,7 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
if (Z_TYPE_P(data) == IS_OBJECT) {
data = (zval*)Z_OBJ_P(data);
}
- if ((node_ptr = zend_hash_index_find_ptr(SOAP_GLOBAL(ref_map), (php_uint_t)data)) != NULL) {
+ if ((node_ptr = zend_hash_index_find_ptr(SOAP_GLOBAL(ref_map), (zend_ulong)data)) != NULL) {
xmlAttrPtr attr = node_ptr->properties;
char *id;
smart_str prefix = {0};
@@ -317,7 +317,7 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
} else {
SOAP_GLOBAL(cur_uniq_ref)++;
smart_str_appendl(&prefix, "#ref", 4);
- smart_str_append_int(&prefix, SOAP_GLOBAL(cur_uniq_ref));
+ smart_str_append_long(&prefix, SOAP_GLOBAL(cur_uniq_ref));
smart_str_0(&prefix);
id = prefix.s->val;
xmlSetProp(node_ptr, BAD_CAST("id"), BAD_CAST(id+1));
@@ -334,7 +334,7 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
} else {
SOAP_GLOBAL(cur_uniq_ref)++;
smart_str_appendl(&prefix, "#ref", 4);
- smart_str_append_int(&prefix, SOAP_GLOBAL(cur_uniq_ref));
+ smart_str_append_long(&prefix, SOAP_GLOBAL(cur_uniq_ref));
smart_str_0(&prefix);
id = prefix.s->val;
set_ns_prop(node_ptr, SOAP_1_2_ENC_NAMESPACE, "id", id+1);
@@ -344,7 +344,7 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
smart_str_free(&prefix);
return 1;
} else {
- zend_hash_index_update_ptr(SOAP_GLOBAL(ref_map), (php_uint_t)data, node);
+ zend_hash_index_update_ptr(SOAP_GLOBAL(ref_map), (zend_ulong)data, node);
}
}
return 0;
@@ -355,7 +355,7 @@ static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
zval *data_ptr;
if (SOAP_GLOBAL(ref_map)) {
- if ((data_ptr = zend_hash_index_find(SOAP_GLOBAL(ref_map), (php_uint_t)node)) != NULL) {
+ if ((data_ptr = zend_hash_index_find(SOAP_GLOBAL(ref_map), (zend_ulong)node)) != NULL) {
if (!Z_REFCOUNTED_P(data) ||
!Z_REFCOUNTED_P(data_ptr) ||
Z_COUNTED_P(data) != Z_COUNTED_P(data_ptr)) {
@@ -371,7 +371,7 @@ static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
static void soap_add_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
{
if (SOAP_GLOBAL(ref_map)) {
- zend_hash_index_update(SOAP_GLOBAL(ref_map), (php_uint_t)node, data);
+ zend_hash_index_update(SOAP_GLOBAL(ref_map), (zend_ulong)node, data);
}
}
@@ -397,23 +397,23 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_P(zns), Z_STRVAL_P(zstype));
} else {
zns = NULL;
- enc = get_encoder_ex(SOAP_GLOBAL(sdl), Z_STRVAL_P(zstype), Z_STRSIZE_P(zstype));
+ enc = get_encoder_ex(SOAP_GLOBAL(sdl), Z_STRVAL_P(zstype), Z_STRLEN_P(zstype));
}
if (enc == NULL && SOAP_GLOBAL(typemap)) {
smart_str nscat = {0};
if (zns != NULL) {
- smart_str_appendl(&nscat, Z_STRVAL_P(zns), Z_STRSIZE_P(zns));
+ smart_str_appendl(&nscat, Z_STRVAL_P(zns), Z_STRLEN_P(zns));
smart_str_appendc(&nscat, ':');
}
- smart_str_appendl(&nscat, Z_STRVAL_P(zstype), Z_STRSIZE_P(zstype));
+ smart_str_appendl(&nscat, Z_STRVAL_P(zstype), Z_STRLEN_P(zstype));
smart_str_0(&nscat);
enc = zend_hash_find_ptr(SOAP_GLOBAL(typemap), nscat.s);
smart_str_free(&nscat);
}
}
if (enc == NULL) {
- enc = get_conversion(Z_IVAL_P(ztype));
+ enc = get_conversion(Z_LVAL_P(ztype));
}
if (enc == NULL) {
enc = encode;
@@ -449,7 +449,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
ZEND_HASH_FOREACH_STR_KEY_VAL(SOAP_GLOBAL(class_map), type_name, tmp) {
if (Z_TYPE_P(tmp) == IS_STRING &&
- ce->name->len == Z_STRSIZE_P(tmp) &&
+ ce->name->len == Z_STRLEN_P(tmp) &&
zend_binary_strncasecmp(ce->name->val, ce->name->len, Z_STRVAL_P(tmp), ce->name->len, ce->name->len) == 0 &&
type_name) {
@@ -600,7 +600,7 @@ xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr par
soap_error0(E_ERROR, "Encoding: Error calling to_xml callback");
}
if (Z_TYPE(return_value) == IS_STRING) {
- xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL(return_value), Z_STRSIZE(return_value));
+ xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL(return_value), Z_STRLEN(return_value));
if (doc && doc->children) {
ret = xmlDocCopyNode(doc->children, parent->doc, 1);
}
@@ -789,7 +789,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
return ret;
}
- str = STR_ALLOC(strlen((char*)data->children->content) / 2, 0);
+ str = zend_string_alloc(strlen((char*)data->children->content) / 2, 0);
for (i = j = 0; i < str->len; i++) {
c = data->children->content[j++];
if (c >= '0' && c <= '9') {
@@ -813,7 +813,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
}
}
str->val[str->len] = '\0';
- ZVAL_STR(ret, str);
+ ZVAL_NEW_STR(ret, str);
} else {
ZVAL_EMPTY_STRING(ret);
}
@@ -831,15 +831,15 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo
FIND_ZVAL_NULL(data, ret, style);
if (Z_TYPE_P(data) == IS_STRING) {
- str = estrndup(Z_STRVAL_P(data), Z_STRSIZE_P(data));
- new_len = Z_STRSIZE_P(data);
+ str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
+ new_len = Z_STRLEN_P(data);
} else {
zval tmp = *data;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
- str = estrndup(Z_STRVAL(tmp), Z_STRSIZE(tmp));
- new_len = Z_STRSIZE(tmp);
+ str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
+ new_len = Z_STRLEN(tmp);
zval_dtor(&tmp);
}
@@ -918,19 +918,19 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo
FIND_ZVAL_NULL(data, ret, style);
if (Z_TYPE_P(data) == IS_STRING) {
- str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRSIZE_P(data));
+ str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRLEN_P(data));
text = xmlNewTextLen(BAD_CAST(str->val), str->len);
xmlAddChild(ret, text);
- STR_RELEASE(str);
+ zend_string_release(str);
} else {
zval tmp;
ZVAL_DUP(&tmp, data);
convert_to_string(&tmp);
- str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRSIZE(tmp));
+ str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRLEN(tmp));
text = xmlNewTextLen(BAD_CAST(str->val), str->len);
xmlAddChild(ret, text);
- STR_RELEASE(str);
+ zend_string_release(str);
zval_dtor(&tmp);
}
@@ -958,15 +958,15 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo
convert_to_string(&tmp);
data = &tmp;
}
- str = (unsigned char *) safe_emalloc(Z_STRSIZE_P(data) * 2, sizeof(char), 1);
+ str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data) * 2, sizeof(char), 1);
- for (i = j = 0; i < Z_STRSIZE_P(data); i++) {
+ for (i = j = 0; i < Z_STRLEN_P(data); i++) {
str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) >> 4];
str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) & 15];
}
str[j] = '\0';
- text = xmlNewTextLen(str, Z_STRSIZE_P(data) * 2 * sizeof(char));
+ text = xmlNewTextLen(str, Z_STRLEN_P(data) * 2 * sizeof(char));
xmlAddChild(ret, text);
efree(str);
if (data == &tmp) {
@@ -986,12 +986,12 @@ static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
if (data && data->children) {
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
- php_int_t lval;
+ zend_long lval;
double dval;
whiteSpace_collapse(data->children->content);
switch (is_numeric_string((char*)data->children->content, strlen((char*)data->children->content), &lval, &dval, 0)) {
- case IS_INT:
+ case IS_LONG:
ZVAL_DOUBLE(ret, lval);
break;
case IS_DOUBLE:
@@ -1024,15 +1024,15 @@ static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_
if (data && data->children) {
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
- php_int_t lval;
+ zend_long lval;
double dval;
whiteSpace_collapse(data->children->content);
errno = 0;
switch (is_numeric_string((char*)data->children->content, strlen((char*)data->children->content), &lval, &dval, 0)) {
- case IS_INT:
- ZVAL_INT(ret, lval);
+ case IS_LONG:
+ ZVAL_LONG(ret, lval);
break;
case IS_DOUBLE:
ZVAL_DOUBLE(ret, dval);
@@ -1066,11 +1066,11 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode
zval tmp = *data;
zval_copy_ctor(&tmp);
- if (Z_TYPE(tmp) != IS_INT) {
- convert_to_int(&tmp);
+ if (Z_TYPE(tmp) != IS_LONG) {
+ convert_to_long(&tmp);
}
convert_to_string(&tmp);
- xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRSIZE(tmp));
+ xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
zval_dtor(&tmp);
}
@@ -1201,7 +1201,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
/* Hack for bug #32455 */
zend_property_info *property_info;
- property_info = zend_get_property_info(Z_OBJCE_P(object), &member, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1 TSRMLS_CC);
EG(scope) = old_scope;
if (property_info && zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) {
zval_ptr_dtor(&member);
@@ -1717,7 +1717,6 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
}
case XSD_CONTENT_ANY: {
zval *data;
- xmlNodePtr property;
encodePtr enc;
zval rv;
@@ -1731,10 +1730,10 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
zval *val;
ZEND_HASH_FOREACH_VAL(ht, val) {
- property = master_to_xml(enc, val, style, node TSRMLS_CC);
+ master_to_xml(enc, val, style, node TSRMLS_CC);
} ZEND_HASH_FOREACH_END();
} else {
- property = master_to_xml(enc, data, style, node TSRMLS_CC);
+ master_to_xml(enc, data, style, node TSRMLS_CC);
}
return 1;
} else if (model->min_occurs == 0) {
@@ -1985,7 +1984,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
if (Z_TYPE_P(data) == IS_OBJECT) {
const char *class_name;
- zend_unmangle_property_name(str_key->val, str_key->len, &class_name, &prop_name);
+ zend_unmangle_property_name(str_key, &class_name, &prop_name);
} else {
prop_name = str_key->val;
}
@@ -2347,10 +2346,10 @@ iterator_done:
}
}
- smart_str_append_int(&array_size, dims[0]);
+ smart_str_append_long(&array_size, dims[0]);
for (i=1; i<dimension; i++) {
smart_str_appendc(&array_size, ',');
- smart_str_append_int(&array_size, dims[i]);
+ smart_str_append_long(&array_size, dims[i]);
}
efree(value);
@@ -2375,15 +2374,15 @@ iterator_done:
dims = get_position_12(dimension, ext->val);
if (dims[0] == 0) {dims[0] = i;}
- smart_str_append_int(&array_size, dims[0]);
+ smart_str_append_long(&array_size, dims[0]);
for (i=1; i<dimension; i++) {
smart_str_appendc(&array_size, ',');
- smart_str_append_int(&array_size, dims[i]);
+ smart_str_append_long(&array_size, dims[i]);
}
} else {
dims = emalloc(sizeof(int));
*dims = 0;
- smart_str_append_int(&array_size, i);
+ smart_str_append_long(&array_size, i);
}
} else if (sdl_type &&
sdl_type->attributes &&
@@ -2395,10 +2394,10 @@ iterator_done:
dims = get_position_12(dimension, ext->val);
if (dims[0] == 0) {dims[0] = i;}
- smart_str_append_int(&array_size, dims[0]);
+ smart_str_append_long(&array_size, dims[0]);
for (i=1; i<dimension; i++) {
smart_str_appendc(&array_size, ',');
- smart_str_append_int(&array_size, dims[i]);
+ smart_str_append_long(&array_size, dims[i]);
}
if (sdl_type && sdl_type->elements &&
@@ -2422,14 +2421,14 @@ iterator_done:
enc = elementType->encode;
get_type_str(xmlParam, elementType->encode->details.ns, elementType->encode->details.type_str, &array_type);
- smart_str_append_int(&array_size, i);
+ smart_str_append_long(&array_size, i);
dims = safe_emalloc(sizeof(int), dimension, 0);
dims[0] = i;
} else {
enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC);
- smart_str_append_int(&array_size, i);
+ smart_str_append_long(&array_size, i);
dims = safe_emalloc(sizeof(int), dimension, 0);
dims[0] = i;
}
@@ -2442,7 +2441,7 @@ iterator_done:
smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1);
}
smart_str_appendc(&array_type, '[');
- smart_str_append(&array_type, &array_size);
+ smart_str_append_smart_str(&array_type, &array_size);
smart_str_appendc(&array_type, ']');
smart_str_0(&array_type);
set_ns_prop(xmlParam, SOAP_1_1_ENC_NAMESPACE, "arrayType", array_type.s->val);
@@ -2485,14 +2484,12 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS
int* dims = NULL;
int* pos = NULL;
xmlAttrPtr attr;
- sdlPtr sdl;
sdlAttributePtr arrayType;
sdlExtraAttributePtr ext;
sdlTypePtr elementType;
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
- sdl = SOAP_GLOBAL(sdl);
if (data &&
(attr = get_attribute(data->properties,"arrayType")) &&
@@ -2689,7 +2686,7 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP
{
zval *temp_data;
zend_string *key_val;
- php_uint_t int_val;
+ zend_ulong int_val;
xmlNodePtr xmlParam;
xmlNodePtr xparam, item;
xmlNodePtr key;
@@ -2712,7 +2709,7 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP
xmlNodeSetContent(key, BAD_CAST(key_val->val));
} else {
smart_str tmp = {0};
- smart_str_append_int(&tmp, int_val);
+ smart_str_append_long(&tmp, int_val);
smart_str_0(&tmp);
if (style == SOAP_ENCODED) {
@@ -2765,8 +2762,8 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
if (Z_TYPE(key) == IS_STRING) {
zend_symtable_update(Z_ARRVAL_P(ret), Z_STR(key), &value);
- } else if (Z_TYPE(key) == IS_INT) {
- zend_hash_index_update(Z_ARRVAL_P(ret), Z_IVAL(key), &value);
+ } else if (Z_TYPE(key) == IS_LONG) {
+ zend_hash_index_update(Z_ARRVAL_P(ret), Z_LVAL(key), &value);
} else {
soap_error0(E_ERROR, "Encoding: Can't decode apache map, only Strings or Longs are allowd as keys");
}
@@ -2863,7 +2860,7 @@ static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data T
xmlNsPtr nsptr;
object_init_ex(&soapvar, soap_var_class_entry);
- add_property_int(&soapvar, "enc_type", enc->details.type);
+ add_property_long(&soapvar, "enc_type", enc->details.type);
Z_DELREF_P(ret);
add_property_zval(&soapvar, "enc_value", ret);
parse_namespace(type_name, &cptype, &ns);
@@ -2896,12 +2893,12 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
xmlAddChild(parent, xmlParam);
FIND_ZVAL_NULL(data, xmlParam, style);
- if (Z_TYPE_P(data) == IS_INT) {
- timestamp = Z_IVAL_P(data);
+ if (Z_TYPE_P(data) == IS_LONG) {
+ timestamp = Z_LVAL_P(data);
ta = php_localtime_r(&timestamp, &tmbuf);
/*ta = php_gmtime_r(&timestamp, &tmbuf);*/
if (!ta) {
- soap_error1(E_ERROR, "Encoding: Invalid timestamp %ld", Z_IVAL_P(data));
+ soap_error1(E_ERROR, "Encoding: Invalid timestamp %pd", Z_LVAL_P(data));
}
buf = (char *) emalloc(buf_len);
@@ -2935,7 +2932,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
xmlNodeSetContent(xmlParam, BAD_CAST(buf));
efree(buf);
} else if (Z_TYPE_P(data) == IS_STRING) {
- xmlNodeSetContentLen(xmlParam, BAD_CAST(Z_STRVAL_P(data)), Z_STRSIZE_P(data));
+ xmlNodeSetContentLen(xmlParam, BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data));
}
if (style == SOAP_ENCODED) {
@@ -3043,7 +3040,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
convert_to_string(&tmp);
data = &tmp;
}
- str = estrndup(Z_STRVAL_P(data), Z_STRSIZE_P(data));
+ str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
whiteSpace_collapse(BAD_CAST(str));
start = str;
while (start != NULL && *start != '\0') {
@@ -3144,13 +3141,13 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP
return ret;
}
if (Z_TYPE_P(data) == IS_STRING) {
- ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRSIZE_P(data));
+ ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data));
} else {
zval tmp = *data;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
- ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRSIZE(tmp));
+ ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
zval_dtor(&tmp);
}
@@ -3251,20 +3248,20 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
if (type) {
if (type->restrictions && Z_TYPE_P(data) == IS_STRING) {
if (type->restrictions->enumeration) {
- if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRSIZE_P(data)+1)) {
+ if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRLEN_P(data)+1)) {
soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data));
}
}
if (type->restrictions->minLength &&
- Z_STRSIZE_P(data) < type->restrictions->minLength->value) {
+ Z_STRLEN_P(data) < type->restrictions->minLength->value) {
soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'");
}
if (type->restrictions->maxLength &&
- Z_STRSIZE_P(data) > type->restrictions->maxLength->value) {
+ Z_STRLEN_P(data) > type->restrictions->maxLength->value) {
soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'");
}
if (type->restrictions->length &&
- Z_STRSIZE_P(data) != type->restrictions->length->value) {
+ Z_STRLEN_P(data) != type->restrictions->length->value) {
soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'");
}
}
@@ -3426,7 +3423,7 @@ xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns)
while (1) {
smart_str_appendl(&prefix, "ns", 2);
- smart_str_append_int(&prefix, num);
+ smart_str_append_long(&prefix, num);
smart_str_0(&prefix);
if (xmlSearchNs(node->doc, node, BAD_CAST(prefix.s->val)) == NULL) {
break;
@@ -3498,7 +3495,7 @@ encodePtr get_conversion(int encode)
static int is_map(zval *array)
{
- php_uint_t index;
+ zend_ulong index;
zend_string *key;
int i = 0;
@@ -3536,7 +3533,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TS
if ((ztype = zend_hash_str_find(Z_OBJPROP_P(tmp), "enc_type", sizeof("enc_type")-1)) == NULL) {
soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property");
}
- cur_type = Z_IVAL_P(ztype);
+ cur_type = Z_LVAL_P(ztype);
if ((ztype = zend_hash_str_find(Z_OBJPROP_P(tmp), "enc_stype", sizeof("enc_stype")-1)) != NULL) {
cur_stype = Z_STRVAL_P(ztype);