From d3a538a4c07f846158a1abec62ac7ab8927dd24e Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 13:16:53 -0300 Subject: [PATCH 01/13] exif: Remove zend_error usage --- ext/exif/exif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index a156a3a63ad2..4c17c2205a5b 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1337,7 +1337,7 @@ static HashTable *exif_make_tag_ht(tag_info_type *tag_table) zend_hash_init(ht, 0, NULL, NULL, 1); while (tag_table->Tag != TAG_END_OF_LIST) { if (!zend_hash_index_add_ptr(ht, tag_table->Tag, tag_table->Desc)) { - zend_error(E_CORE_ERROR, "Duplicate tag %x", tag_table->Tag); + php_error_docref(NULL, E_CORE_ERROR, "Duplicate tag %x", tag_table->Tag); } tag_table++; } From edd4cc9c9bdf78abc349ab99086dd98b4ffdffd3 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 14:14:20 -0300 Subject: [PATCH 02/13] sodium: Remove zend_error usage --- ext/sodium/libsodium.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c index 8c85991150b5..c914b6dffbe7 100644 --- a/ext/sodium/libsodium.c +++ b/ext/sodium/libsodium.c @@ -1462,7 +1462,7 @@ PHP_FUNCTION(sodium_crypto_pwhash) RETURN_THROWS(); } if (passwd_len <= 0) { - zend_error(E_WARNING, "empty password"); + php_error_docref(NULL, E_WARNING, "empty password"); } if (salt_len != crypto_pwhash_SALTBYTES) { zend_argument_value_error(3, "must be SODIUM_CRYPTO_PWHASH_SALTBYTES bytes long"); @@ -1536,7 +1536,7 @@ PHP_FUNCTION(sodium_crypto_pwhash_str) RETURN_THROWS(); } if (passwd_len <= 0) { - zend_error(E_WARNING, "empty password"); + php_error_docref(NULL, E_WARNING, "empty password"); } if (opslimit < crypto_pwhash_OPSLIMIT_MIN) { zend_argument_value_error(2, "must be greater than or equal to %d", crypto_pwhash_OPSLIMIT_MIN); @@ -1601,7 +1601,7 @@ PHP_FUNCTION(sodium_crypto_pwhash_str_verify) RETURN_THROWS(); } if (passwd_len <= 0) { - zend_error(E_WARNING, "empty password"); + php_error_docref(NULL, E_WARNING, "empty password"); } if (crypto_pwhash_str_verify (hash_str, passwd, (unsigned long long) passwd_len) == 0) { @@ -1647,7 +1647,7 @@ PHP_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256) RETURN_THROWS(); } if (passwd_len <= 0) { - zend_error(E_WARNING, "empty password"); + php_error_docref(NULL, E_WARNING, "empty password"); } if (salt_len != crypto_pwhash_scryptsalsa208sha256_SALTBYTES) { zend_argument_value_error(3, "must be SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES bytes long"); @@ -1703,7 +1703,7 @@ PHP_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256_str) RETURN_THROWS(); } if (passwd_len <= 0) { - zend_error(E_WARNING, "empty password"); + php_error_docref(NULL, E_WARNING, "empty password"); } if (opslimit < crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE) { zend_argument_value_error(2, "must be greater than or equal to %d", crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE); @@ -1743,10 +1743,10 @@ PHP_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256_str_verify) RETURN_THROWS(); } if (passwd_len <= 0) { - zend_error(E_WARNING, "empty password"); + php_error_docref(NULL, E_WARNING, "empty password"); } if (hash_str_len != crypto_pwhash_scryptsalsa208sha256_STRBYTES - 1) { - zend_error(E_WARNING, "wrong size for the hashed password"); + php_error_docref(NULL, E_WARNING, "wrong size for the hashed password"); RETURN_FALSE; } if (crypto_pwhash_scryptsalsa208sha256_str_verify From d2c2c5c071fc80034c20bb619c174554a75e8a0d Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 14:18:41 -0300 Subject: [PATCH 03/13] soap: Remove php_error usage There is some more usage with i.e. soap_error0, which is a little crude. --- ext/soap/soap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 171b529b3355..f595773a918a 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1682,7 +1682,7 @@ PHP_METHOD(SoapServer, handle) call_status = call_user_function(EG(function_table), NULL, &function_name, &retval, num_params, params); } } else { - php_error(E_ERROR, "Function '%s' doesn't exist", Z_STRVAL(function_name)); + php_error_docref(NULL, E_ERROR, "Function '%s' doesn't exist", Z_STRVAL(function_name)); } if (EG(exception)) { @@ -3409,7 +3409,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c if (*version == SOAP_1_2) { soap_server_fault_en("rpc:ProcedureNotPresent","Procedure not present"); } else { - php_error(E_ERROR, "Procedure '%s' not present", func->name); + php_error_docref(NULL, E_ERROR, "Procedure '%s' not present", func->name); } } } From 82f6938bf60d2d1dc4b5d887168adbe87ebf3b4f Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 15:01:29 -0300 Subject: [PATCH 04/13] soap: remove soap_errorN macros and use docref --- ext/soap/php_encoding.c | 108 ++++++------ ext/soap/php_schema.c | 160 +++++++++--------- ext/soap/php_sdl.c | 106 ++++++------ ext/soap/php_soap.h | 13 +- ext/soap/soap.c | 2 +- ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt | 2 +- ext/soap/tests/bugs/bug34657.phpt | 3 +- ext/soap/tests/bugs/bug39832.phpt | 2 +- ext/soap/tests/bugs/bug42151.phpt | 2 +- ext/soap/tests/bugs/bug42488.phpt | 2 +- ext/soap/tests/bugs/bug50698_2.phpt | 36 +++- ext/soap/tests/bugs/bug50698_3.phpt | 36 +++- ext/soap/tests/bugs/bug62900.phpt | 8 +- ext/soap/tests/bugs/bug68576.phpt | 2 +- ext/soap/tests/bugs/bug79357.phpt | 2 +- ext/soap/tests/bugs/bug80672.phpt | 2 +- ext/soap/tests/bugs/gh22167.phpt | 40 ++--- ext/soap/tests/hexbin_odd_length.phpt | 2 +- .../Round3/GroupF/r3_groupF_extreq_001w.phpt | 2 +- ext/soap/tests/scalar_error_messages.phpt | 6 +- ext/soap/tests/schema/schema068.phpt | 2 +- ext/soap/tests/soap12/T27.phpt | 2 +- ext/soap/tests/soap12/T56.phpt | 2 +- ext/soap/tests/soap12/T58.phpt | 2 +- ext/soap/tests/soap12/T59.phpt | 2 +- ext/soap/tests/soap12/T61.phpt | 2 +- ext/soap/tests/soap_array_index_overflow.phpt | 6 +- 27 files changed, 307 insertions(+), 247 deletions(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index d08c5a683189..3ad9935af4ab 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -376,7 +376,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml zval *ztype = Z_VAR_ENC_TYPE_P(data); if (Z_TYPE_P(ztype) != IS_LONG) { - soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); + soap_error(E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); } zval *zstype = Z_VAR_ENC_STYPE_P(data); @@ -591,7 +591,7 @@ xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr par ZVAL_NULL(&return_value); if (call_user_function(NULL, NULL, &type->map->to_xml, &return_value, 1, data) == FAILURE) { - soap_error0(E_ERROR, "Encoding: Error calling to_xml callback"); + soap_error(E_ERROR, "Encoding: Error calling to_xml callback"); } if (Z_TYPE(return_value) == IS_STRING) { xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL(return_value), Z_STRLEN(return_value)); @@ -628,7 +628,7 @@ zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node) xmlFreeNode(copy); if (call_user_function(NULL, NULL, &type->map->to_zval, ret, 1, &data) == FAILURE) { - soap_error0(E_ERROR, "Encoding: Error calling from_xml callback"); + soap_error(E_ERROR, "Encoding: Error calling from_xml callback"); } else if (EG(exception)) { ZVAL_NULL(ret); } @@ -665,7 +665,7 @@ static zval *to_zval_string(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { ZVAL_STRING(ret, (char*)data->children->content); } else { - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_EMPTY_STRING(ret); @@ -698,7 +698,7 @@ static zval *to_zval_stringr(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { ZVAL_STRING(ret, (char*)data->children->content); } else { - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_EMPTY_STRING(ret); @@ -731,7 +731,7 @@ static zval *to_zval_stringc(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { ZVAL_STRING(ret, (char*)data->children->content); } else { - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_EMPTY_STRING(ret); @@ -750,17 +750,17 @@ static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data) whiteSpace_collapse(data->children->content); str = php_base64_decode(data->children->content, strlen((char*)data->children->content)); if (!str) { - soap_error1(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } ZVAL_STR(ret, str); } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { str = php_base64_decode(data->children->content, strlen((char*)data->children->content)); if (!str) { - soap_error1(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } ZVAL_STR(ret, str); } else { - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_EMPTY_STRING(ret); @@ -781,12 +781,12 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data) if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { whiteSpace_collapse(data->children->content); } else if (data->children->type != XML_CDATA_SECTION_NODE || data->children->next != NULL) { - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); return ret; } content_len = strlen((char*) data->children->content); if (content_len % 2 != 0) { - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain an even number of hexadecimal digits", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain an even number of hexadecimal digits", soap_type_name(type)); return ret; } str = zend_string_alloc(content_len / 2, 0); @@ -799,7 +799,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (c >= 'A' && c <= 'F') { ZSTR_VAL(str)[i] = (c - 'A' + 10) << 4; } else { - soap_error1(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } c = data->children->content[j++]; if (c >= '0' && c <= '9') { @@ -809,7 +809,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (c >= 'A' && c <= 'F') { ZSTR_VAL(str)[i] |= c - 'A' + 10; } else { - soap_error1(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } } ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0'; @@ -928,7 +928,7 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo err[i++] = 0; } - soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", err); + soap_error(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", err); } text = xmlNewTextLen(BAD_CAST(str), new_len); @@ -1030,11 +1030,11 @@ static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (strncasecmp((char*)data->children->content, "-INF", sizeof("-INF")-1) == 0) { ZVAL_DOUBLE(ret, -php_get_inf()); } else { - soap_error1(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } } } else { - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_NULL(ret); @@ -1063,10 +1063,10 @@ static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data) ZVAL_DOUBLE(ret, dval); break; default: - soap_error1(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } } else { - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_NULL(ret); @@ -1132,7 +1132,7 @@ static zval *to_zval_bool(zval *ret, encodeTypePtr type, xmlNodePtr data) } if (data->children->type != XML_TEXT_NODE || data->children->next != NULL) { // TODO Convert to exception? - soap_error1(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } whiteSpace_collapse(data->children->content); @@ -1314,7 +1314,7 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr r_node = check_and_resolve_href(node); if (r_node && r_node->children && r_node->children->content) { if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)r_node->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, r_node->children->content); + soap_error(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, r_node->children->content); } master_to_zval(&val, model->u.element->encode, r_node); } else if (model->u.element->fixed) { @@ -1339,7 +1339,7 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr ZVAL_NULL(&val); if (node && node->children && node->children->content) { if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)node->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content); + soap_error(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content); } master_to_zval(&val, model->u.element->encode, node); } else if (model->u.element->fixed) { @@ -1542,7 +1542,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z if (val && val->children && val->children->content) { str_val = (char*)val->children->content; if (attr->fixed && strcmp(attr->fixed, str_val) != 0) { - soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, str_val); + soap_error(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, str_val); } } else if (attr->fixed) { str_val = attr->fixed; @@ -1665,7 +1665,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * property = master_to_xml(enc, val, style, node); if (property->children && property->children->content && model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); + soap_error(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); } } xmlNodeSetName(property, BAD_CAST(model->u.element->name)); @@ -1687,7 +1687,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * property = master_to_xml(enc, data, style, node); if (property->children && property->children->content && model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); + soap_error(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); } } xmlNodeSetName(property, BAD_CAST(model->u.element->name)); @@ -1714,7 +1714,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * return 2; } else { if (strict) { - soap_error1(E_ERROR, "Encoding: object has no '%s' property", model->u.element->name); + soap_error(E_ERROR, "Encoding: object has no '%s' property", model->u.element->name); } return 0; } @@ -1745,7 +1745,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * return 2; } else { if (strict) { - soap_error0(E_ERROR, "Encoding: object has no 'any' property"); + soap_error(E_ERROR, "Encoding: object has no 'any' property"); } return 0; } @@ -1950,7 +1950,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo dummy = master_to_xml(attr->encode, zattr, SOAP_LITERAL, xmlParam); if (dummy->children && dummy->children->content) { if (attr->fixed && strcmp(attr->fixed, (char*)dummy->children->content) != 0) { - soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, dummy->children->content); + soap_error(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, dummy->children->content); } /* we need to handle xml: namespace specially, since it is an implicit schema. Otherwise, use form. @@ -2052,7 +2052,7 @@ static int calc_dimension_12(const char* str) flag = 1; } } else if (*str == '*') { - soap_error0(E_ERROR, "Encoding: '*' may only be first arraySize value in list"); + soap_error(E_ERROR, "Encoding: '*' may only be first arraySize value in list"); } else { flag = 0; } @@ -2064,7 +2064,7 @@ static int calc_dimension_12(const char* str) static void soap_array_position_add_digit(int *position, int digit) { if (UNEXPECTED(*position > (INT_MAX - digit) / 10)) { - soap_error0(E_ERROR, "Encoding: array index out of range"); + soap_error(E_ERROR, "Encoding: array index out of range"); } *position = (*position * 10) + digit; @@ -2092,7 +2092,7 @@ static int* get_position_12(int dimension, const char* str) } soap_array_position_add_digit(&pos[i], *str - '0'); } else if (*str == '*') { - soap_error0(E_ERROR, "Encoding: '*' may only be first arraySize value in list"); + soap_error(E_ERROR, "Encoding: '*' may only be first arraySize value in list"); } else { flag = 0; } @@ -2713,7 +2713,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data) efree(pos); zval_ptr_dtor(ret); ZVAL_UNDEF(ret); - soap_error0(E_ERROR, "Encoding: array index out of range"); + soap_error(E_ERROR, "Encoding: array index out of range"); } pos[i]++; if (pos[i] < dims[i]) { @@ -2806,12 +2806,12 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data) FOREACHNODE(trav, "item", item) { xmlKey = get_node(item->children, "key"); if (!xmlKey) { - soap_error0(E_ERROR, "Encoding: Can't decode apache map, missing key"); + soap_error(E_ERROR, "Encoding: Can't decode apache map, missing key"); } xmlValue = get_node(item->children, "value"); if (!xmlValue) { - soap_error0(E_ERROR, "Encoding: Can't decode apache map, missing value"); + soap_error(E_ERROR, "Encoding: Can't decode apache map, missing value"); } ZVAL_NULL(&key); @@ -2824,7 +2824,7 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data) } 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 allowed as keys"); + soap_error(E_ERROR, "Encoding: Can't decode apache map, only Strings or Longs are allowed as keys"); } zval_ptr_dtor(&key); } @@ -2956,7 +2956,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma ta = php_localtime_r(×tamp, &tmbuf); /*ta = php_gmtime_r(×tamp, &tmbuf);*/ if (!ta) { - soap_error1(E_ERROR, "Encoding: Invalid timestamp " ZEND_LONG_FMT, Z_LVAL_P(data)); + soap_error(E_ERROR, "Encoding: Invalid timestamp " ZEND_LONG_FMT, Z_LVAL_P(data)); } buf = (char *) emalloc(buf_len); @@ -3001,7 +3001,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma xmlNodeSetContentLen(xmlParam, BAD_CAST(ZSTR_VAL(formatted_date_string)), ZSTR_LEN(formatted_date_string)); zend_string_release_ex(formatted_date_string, false); } else { - soap_error0(E_ERROR, "Encoding: Invalid DateTimeInterface"); + soap_error(E_ERROR, "Encoding: Invalid DateTimeInterface"); } } } @@ -3101,7 +3101,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP } smart_str_appends(&list, (char*)dummy->children->content); } else { - soap_error2(E_ERROR, + soap_error(E_ERROR, "Encoding: Failed to encode list item of type '%s' for list type '%s'", soap_type_name(&list_enc->details), soap_type_name(enc)); } @@ -3145,7 +3145,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP } smart_str_appends(&list, (char*)dummy->children->content); } else { - soap_error2(E_ERROR, + soap_error(E_ERROR, "Encoding: Failed to encode list item of type '%s' for list type '%s'", soap_type_name(&list_enc->details), soap_type_name(enc)); } @@ -3273,20 +3273,20 @@ zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data) } if (type->restrictions->enumeration) { if (!zend_hash_exists(type->restrictions->enumeration,data->children->content,strlen(data->children->content)+1)) { - soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\"", data->children->content); + soap_error(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\"", data->children->content); } } if (type->restrictions->minLength && strlen(data->children->content) < type->restrictions->minLength->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'"); + soap_error(E_WARNING, "Encoding: Restriction: length less than 'minLength'"); } if (type->restrictions->maxLength && strlen(data->children->content) > type->restrictions->maxLength->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); + soap_error(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); } if (type->restrictions->length && strlen(data->children->content) != type->restrictions->length->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); + soap_error(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); } } */ @@ -3312,7 +3312,7 @@ zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data) } return to_zval_object(ret, enc, data); default: - soap_error0(E_ERROR, "Encoding: Internal Error"); + soap_error(E_ERROR, "Encoding: Internal Error"); return guess_zval_convert(ret, enc, data); } } @@ -3336,20 +3336,20 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo 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_STRLEN_P(data)+1)) { - soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data)); + soap_error(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data)); } } if (type->restrictions->minLength && Z_STRLEN_P(data) < type->restrictions->minLength->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'"); + soap_error(E_WARNING, "Encoding: Restriction: length less than 'minLength'"); } if (type->restrictions->maxLength && Z_STRLEN_P(data) > type->restrictions->maxLength->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); + soap_error(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); } if (type->restrictions->length && Z_STRLEN_P(data) != type->restrictions->length->value) { - soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); + soap_error(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); } } } @@ -3380,7 +3380,7 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo } break; default: - soap_error0(E_ERROR, "Encoding: Internal Error"); + soap_error(E_ERROR, "Encoding: Internal Error"); break; } if (style == SOAP_ENCODED) { @@ -3398,12 +3398,12 @@ static xmlNodePtr check_and_resolve_href(xmlNodePtr data) if (href->children->content[0] == '#') { xmlNodePtr ret = get_node_with_attribute_recursive(data->doc->children, NULL, "id", (char*)&href->children->content[1]); if (!ret) { - soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); + soap_error(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); } return ret; } else { /* TODO: External href....? */ - soap_error1(E_ERROR, "Encoding: External reference '%s'", href->children->content); + soap_error(E_ERROR, "Encoding: External reference '%s'", href->children->content); } } /* SOAP 1.2 enc:id enc:ref */ @@ -3419,9 +3419,9 @@ static xmlNodePtr check_and_resolve_href(xmlNodePtr data) } ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", (char*)id, SOAP_1_2_ENC_NAMESPACE); if (!ret) { - soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); + soap_error(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); } else if (ret == data) { - soap_error1(E_ERROR, "Encoding: Violation of id and ref information items '%s'", href->children->content); + soap_error(E_ERROR, "Encoding: Violation of id and ref information items '%s'", href->children->content); } return ret; } @@ -3570,7 +3570,7 @@ encodePtr get_conversion(int encode) encodePtr enc; if ((enc = zend_hash_index_find_ptr(&php_soap_defEncIndex, encode)) == NULL) { - soap_error0(E_ERROR, "Encoding: Cannot find encoding"); + soap_error(E_ERROR, "Encoding: Cannot find encoding"); return NULL; } else { return enc; @@ -3600,7 +3600,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type) Z_OBJCE_P(tmp) == soap_var_class_entry) { zval *ztype = Z_VAR_ENC_TYPE_P(tmp); if (Z_TYPE_P(ztype) != IS_LONG) { - soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); + soap_error(E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); } cur_type = Z_LVAL_P(ztype); if (cur_type == UNKNOWN_TYPE) { diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index b675b97b469f..c65f9815e633 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -64,12 +64,12 @@ static int schema_parse_int(const xmlChar *value, const char *name, bool allow_n errno = 0; lval = ZEND_STRTOL(str, NULL, 10); if (UNEXPECTED(oflow_info || (errno == ERANGE && lval != 0))) { - soap_error1(E_ERROR, "Parsing Schema: %s value is out of range", name); + soap_error(E_ERROR, "Parsing Schema: %s value is out of range", name); } } if (UNEXPECTED(ZEND_LONG_EXCEEDS_INT(lval) || (!allow_negative && lval < 0))) { - soap_error1(E_ERROR, "Parsing Schema: %s value is out of range", name); + soap_error(E_ERROR, "Parsing Schema: %s value is out of range", name); } return (int) lval; @@ -150,13 +150,13 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA if (doc == NULL) { requestify_string(&location); - soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location); + soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s'", location); } schema = get_node(doc->children, "schema"); if (schema == NULL) { requestify_string(&location); xmlFreeDoc(doc); - soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location); + soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s'", location); } new_tns = get_attribute(schema->properties, "targetNamespace"); if (import) { @@ -164,12 +164,12 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA requestify_string(&location); if (new_tns == NULL) { xmlFreeDoc(doc); - soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', missing 'targetNamespace', expected '%s'", location, ns->children->content); + soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s', missing 'targetNamespace', expected '%s'", location, ns->children->content); } else { /* Have to make a copy to avoid a UAF after freeing `doc` */ const char *target_ns_copy = estrdup((const char *) new_tns->children->content); xmlFreeDoc(doc); - soap_error3(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s', expected '%s'", location, target_ns_copy, ns->children->content); + soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s', expected '%s'", location, target_ns_copy, ns->children->content); } } if (ns == NULL && new_tns != NULL) { @@ -177,7 +177,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA /* Have to make a copy to avoid a UAF after freeing `doc` */ const char *target_ns_copy = estrdup((const char *) new_tns->children->content); xmlFreeDoc(doc); - soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s', expected no 'targetNamespace'", location, target_ns_copy); + soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s', expected no 'targetNamespace'", location, target_ns_copy); } } else { new_tns = get_attribute(schema->properties, "targetNamespace"); @@ -188,7 +188,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA } else if (tns != NULL && xmlStrcmp(tns->children->content, new_tns->children->content) != 0) { requestify_string(&location); xmlFreeDoc(doc); - soap_error1(E_ERROR, "Parsing Schema: can't include schema from '%s', different 'targetNamespace'", location); + soap_error(E_ERROR, "Parsing Schema: can't include schema from '%s', different 'targetNamespace'", location); } } zend_hash_str_add_ptr(&ctx->docs, (char*)location, xmlStrlen(location), doc); @@ -263,7 +263,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema) location = get_attribute(trav->properties, "schemaLocation"); if (location == NULL) { - soap_error0(E_ERROR, "Parsing Schema: include has no 'schemaLocation' attribute"); + soap_error(E_ERROR, "Parsing Schema: include has no 'schemaLocation' attribute"); } else { xmlChar *uri = schema_location_construct_uri(location); schema_load_file(ctx, NULL, uri, tns, 0); @@ -275,7 +275,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema) location = get_attribute(trav->properties, "schemaLocation"); if (location == NULL) { - soap_error0(E_ERROR, "Parsing Schema: redefine has no 'schemaLocation' attribute"); + soap_error(E_ERROR, "Parsing Schema: redefine has no 'schemaLocation' attribute"); } else { xmlChar *uri = schema_location_construct_uri(location); schema_load_file(ctx, NULL, uri, tns, 0); @@ -292,9 +292,9 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema) if (ns != NULL && tns != NULL && xmlStrcmp(ns->children->content, tns->children->content) == 0) { if (location) { - soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content); + soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content); } else { - soap_error0(E_ERROR, "Parsing Schema: can't import schema. Namespace must not match the enclosing schema 'targetNamespace'"); + soap_error(E_ERROR, "Parsing Schema: can't import schema. Namespace must not match the enclosing schema 'targetNamespace'"); } } if (location) { @@ -335,7 +335,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema) } else if (node_is_equal_xsd(trav,"annotation")) { /* TODO: support */ } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in schema", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in schema", trav->name); } trav = trav->next; } @@ -419,7 +419,7 @@ static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, create_encoder(sdl, cur_type, ns->children->content, name->children->content); } else { - soap_error0(E_ERROR, "Parsing Schema: simpleType has no 'name' attribute"); + soap_error(E_ERROR, "Parsing Schema: simpleType has no 'name' attribute"); } trav = simpleType->children; @@ -440,13 +440,13 @@ static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, schema_union(sdl, tns, trav, cur_type); trav = trav->next; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); } } else { - soap_error0(E_ERROR, "Parsing Schema: expected , or in simpleType"); + soap_error(E_ERROR, "Parsing Schema: expected , or in simpleType"); } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); } return TRUE; @@ -502,7 +502,7 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP sdlTypePtr newType; if (itemType != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'itemType' attribute and subtype"); + soap_error(E_ERROR, "Parsing Schema: element has both 'itemType' attribute and subtype"); } newType = emalloc(sizeof(sdlType)); @@ -530,7 +530,7 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP trav = trav->next; } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in list", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in list", trav->name); } return TRUE; } @@ -625,12 +625,12 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp schema_simpleType(sdl, tns, trav, newType); } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); } return TRUE; } @@ -661,13 +661,13 @@ static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpCompT schema_extension_simpleContent(sdl, tns, trav, cur_type); trav = trav->next; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); } } else { - soap_error0(E_ERROR, "Parsing Schema: expected or in simpleContent"); + soap_error(E_ERROR, "Parsing Schema: expected or in simpleContent"); } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); } return TRUE; @@ -705,7 +705,7 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodeP } if (ns) {efree(ns);} } else if (!simpleType) { - soap_error0(E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); + soap_error(E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); } if (cur_type->restrictions == NULL) { @@ -772,13 +772,13 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodeP trav = trav->next; break; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); } trav = trav->next; } } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); } return TRUE; @@ -810,7 +810,7 @@ static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNode } if (ns) {efree(ns);} } else { - soap_error0(E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); + soap_error(E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); } trav = restType->children; @@ -843,12 +843,12 @@ static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNode trav = trav->next; break; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); } return TRUE; @@ -873,7 +873,7 @@ static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valp value = get_attribute(val->properties, "value"); if (value == NULL) { - soap_error0(E_ERROR, "Parsing Schema: missing restriction value"); + soap_error(E_ERROR, "Parsing Schema: missing restriction value"); } (*valptr)->value = schema_parse_int(value->children->content, (const char *) val->name, true); @@ -901,7 +901,7 @@ static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *va value = get_attribute(val->properties, "value"); if (value == NULL) { - soap_error0(E_ERROR, "Parsing Schema: missing restriction value"); + soap_error(E_ERROR, "Parsing Schema: missing restriction value"); } (*valptr)->value = estrdup((char*)value->children->content); @@ -935,7 +935,7 @@ static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr } if (ns) {efree(ns);} } else { - soap_error0(E_ERROR, "Parsing Schema: extension has no 'base' attribute"); + soap_error(E_ERROR, "Parsing Schema: extension has no 'base' attribute"); } trav = extType->children; @@ -953,12 +953,12 @@ static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr trav = trav->next; break; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); } return TRUE; } @@ -990,7 +990,7 @@ static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePt } if (ns) {efree(ns);} } else { - soap_error0(E_ERROR, "Parsing Schema: extension has no 'base' attribute"); + soap_error(E_ERROR, "Parsing Schema: extension has no 'base' attribute"); } trav = extType->children; @@ -1023,12 +1023,12 @@ static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePt trav = trav->next; break; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); } return TRUE; } @@ -1090,7 +1090,7 @@ static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr all, sdlTypePtr cur if (node_is_equal_xsd(trav,"element")) { schema_element(sdl, tns, trav, cur_type, newModel); } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in all", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in all", trav->name); } trav = trav->next; } @@ -1177,7 +1177,7 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp zend_hash_init(sdl->groups, 0, NULL, delete_type, 0); } if (zend_hash_add_ptr(sdl->groups, key.s, newType) == NULL) { - soap_error1(E_ERROR, "Parsing Schema: group '%s' already defined", ZSTR_VAL(key.s)); + soap_error(E_ERROR, "Parsing Schema: group '%s' already defined", ZSTR_VAL(key.s)); } cur_type = newType; @@ -1190,7 +1190,7 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp zend_hash_next_index_insert_ptr(model->u.content, newModel); } } else { - soap_error0(E_ERROR, "Parsing Schema: group has no 'name' nor 'ref' attributes"); + soap_error(E_ERROR, "Parsing Schema: group has no 'name' nor 'ref' attributes"); } schema_min_max(groupType, newModel); @@ -1203,31 +1203,31 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp if (trav != NULL) { if (node_is_equal_xsd(trav,"choice")) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); + soap_error(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); } newModel->kind = XSD_CONTENT_CHOICE; schema_choice(sdl, tns, trav, cur_type, newModel); trav = trav->next; } else if (node_is_equal_xsd(trav,"sequence")) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); + soap_error(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); } newModel->kind = XSD_CONTENT_SEQUENCE; schema_sequence(sdl, tns, trav, cur_type, newModel); trav = trav->next; } else if (node_is_equal_xsd(trav,"all")) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); + soap_error(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); } newModel->kind = XSD_CONTENT_ALL; schema_all(sdl, tns, trav, cur_type, newModel); trav = trav->next; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); } } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); } return TRUE; } @@ -1274,7 +1274,7 @@ static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlT } else if (node_is_equal_xsd(trav,"any")) { schema_any(sdl, tns, trav, cur_type, newModel); } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in choice", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in choice", trav->name); } trav = trav->next; } @@ -1324,7 +1324,7 @@ static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTy } else if (node_is_equal_xsd(trav,"any")) { schema_any(sdl, tns, trav, cur_type, newModel); } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in sequence", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in sequence", trav->name); } trav = trav->next; } @@ -1384,13 +1384,13 @@ static int schema_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compCont schema_extension_complexContent(sdl, tns, trav, cur_type); trav = trav->next; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); } } else { - soap_error0(E_ERROR, "Parsing Schema: or expected in complexContent"); + soap_error(E_ERROR, "Parsing Schema: or expected in complexContent"); } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); } return TRUE; @@ -1469,7 +1469,7 @@ static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, s cur_type = ptr; create_encoder(sdl, cur_type, ns->children->content, name->children->content); } else { - soap_error0(E_ERROR, "Parsing Schema: complexType has no 'name' attribute"); + soap_error(E_ERROR, "Parsing Schema: complexType has no 'name' attribute"); return FALSE; } @@ -1509,14 +1509,14 @@ static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, s trav = trav->next; break; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); } trav = trav->next; } } } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); } return TRUE; } @@ -1619,7 +1619,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp smart_str_0(&key); if (zend_hash_add_ptr(addHash, key.s, newType) == NULL) { if (cur_type == NULL) { - soap_error1(E_ERROR, "Parsing Schema: element '%s' already defined", ZSTR_VAL(key.s)); + soap_error(E_ERROR, "Parsing Schema: element '%s' already defined", ZSTR_VAL(key.s)); } else { zend_hash_next_index_insert_ptr(addHash, newType); } @@ -1639,7 +1639,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp } cur_type = newType; } else { - soap_error0(E_ERROR, "Parsing Schema: element has no 'name' nor 'ref' attributes"); + soap_error(E_ERROR, "Parsing Schema: element has no 'name' nor 'ref' attributes"); } /* nillable = boolean : false */ @@ -1647,7 +1647,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp attr = get_attribute(attrs, "nillable"); if (attr) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'nillable' attributes"); + soap_error(E_ERROR, "Parsing Schema: element has both 'ref' and 'nillable' attributes"); } if (!stricmp((char*)attr->children->content, "true") || !stricmp((char*)attr->children->content, "1")) { @@ -1662,7 +1662,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp attr = get_attribute(attrs, "fixed"); if (attr) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes"); + soap_error(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes"); } cur_type->fixed = estrdup((char*)attr->children->content); } @@ -1670,7 +1670,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp attr = get_attribute(attrs, "default"); if (attr) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes"); + soap_error(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes"); } cur_type->def = estrdup((char*)attr->children->content); } @@ -1716,7 +1716,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp xmlNsPtr nsptr; if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'type' attributes"); + soap_error(E_ERROR, "Parsing Schema: element has both 'ref' and 'type' attributes"); } parse_namespace(type->children->content, &cptype, &str_ns); nsptr = xmlSearchNs(element->doc, element, BAD_CAST(str_ns)); @@ -1734,17 +1734,17 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp if (trav != NULL) { if (node_is_equal_xsd(trav,"simpleType")) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); + soap_error(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); } else if (type != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); + soap_error(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); } schema_simpleType(sdl, tns, trav, cur_type); trav = trav->next; } else if (node_is_equal_xsd(trav,"complexType")) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); + soap_error(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); } else if (type != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); + soap_error(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); } schema_complexType(sdl, tns, trav, cur_type); trav = trav->next; @@ -1758,7 +1758,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp } else if (node_is_equal_xsd(trav,"keyref")) { /* TODO: support */ } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in element", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in element", trav->name); } trav = trav->next; } @@ -1848,11 +1848,11 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl } if (zend_hash_add_ptr(addHash, key.s, newAttr) == NULL) { - soap_error1(E_ERROR, "Parsing Schema: attribute '%s' already defined", ZSTR_VAL(key.s)); + soap_error(E_ERROR, "Parsing Schema: attribute '%s' already defined", ZSTR_VAL(key.s)); } smart_str_free(&key); } else{ - soap_error0(E_ERROR, "Parsing Schema: attribute has no 'name' nor 'ref' attributes"); + soap_error(E_ERROR, "Parsing Schema: attribute has no 'name' nor 'ref' attributes"); return FALSE; /* the above call is noreturn, but not marked as such */ } @@ -1864,7 +1864,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl xmlNsPtr nsptr; if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attribute has both 'ref' and 'type' attributes"); + soap_error(E_ERROR, "Parsing Schema: attribute has both 'ref' and 'type' attributes"); } parse_namespace(type->children->content, &cptype, &str_ns); nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(str_ns)); @@ -1973,9 +1973,9 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl zval zv; if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attribute has both 'ref' attribute and subtype"); + soap_error(E_ERROR, "Parsing Schema: attribute has both 'ref' attribute and subtype"); } else if (type != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attribute has both 'type' attribute and subtype"); + soap_error(E_ERROR, "Parsing Schema: attribute has both 'type' attribute and subtype"); } dummy_type = emalloc(sizeof(sdlType)); memset(dummy_type, 0, sizeof(sdlType)); @@ -1997,7 +1997,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl } } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attribute", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in attribute", trav->name); } return TRUE; } @@ -2033,7 +2033,7 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou smart_str_0(&key); if (zend_hash_add_ptr(ctx->attributeGroups, key.s, newType) == NULL) { - soap_error1(E_ERROR, "Parsing Schema: attributeGroup '%s' already defined", ZSTR_VAL(key.s)); + soap_error(E_ERROR, "Parsing Schema: attributeGroup '%s' already defined", ZSTR_VAL(key.s)); } cur_type = newType; smart_str_free(&key); @@ -2067,7 +2067,7 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou cur_type = NULL; } } else{ - soap_error0(E_ERROR, "Parsing Schema: attributeGroup has no 'name' nor 'ref' attributes"); + soap_error(E_ERROR, "Parsing Schema: attributeGroup has no 'name' nor 'ref' attributes"); } trav = attrGroup->children; @@ -2078,28 +2078,28 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou while (trav != NULL) { if (node_is_equal_xsd(trav,"attribute")) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); + soap_error(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); } schema_attribute(sdl, tns, trav, cur_type, NULL); } else if (node_is_equal_xsd(trav,"attributeGroup")) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); + soap_error(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); } schema_attributeGroup(sdl, tns, trav, cur_type, NULL); } else if (node_is_equal_xsd(trav,"anyAttribute")) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); + soap_error(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); } /* TODO: support */ trav = trav->next; break; } else { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); + soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); } return TRUE; } @@ -2247,7 +2247,7 @@ static void schema_content_model_fixup(sdlCtx *ctx, sdlContentModelPtr model) model->kind = XSD_CONTENT_GROUP; model->u.group = tmp; } else { - soap_error1(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute '%s'", model->u.group_ref); + soap_error(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute '%s'", model->u.group_ref); } break; } @@ -2304,7 +2304,7 @@ static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type) } else if (strcmp(type->ref, XSD_NAMESPACE ":schema") == 0) { type->encode = get_conversion(XSD_ANYXML); } else { - soap_error1(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute '%s'", type->ref); + soap_error(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute '%s'", type->ref); } } efree(type->ref); diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 77d73a2326d7..ff66ffee01c9 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -191,7 +191,7 @@ static int is_wsdl_element(xmlNodePtr node) attr->children && attr->children->content && (strcmp((char*)attr->children->content, "1") == 0 || strcmp((char*)attr->children->content, "true") == 0)) { - soap_error1(E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href); + soap_error(E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href); } return 0; } @@ -310,9 +310,9 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, bool include const xmlError *xmlErrorPtr = xmlGetLastError(); if (xmlErrorPtr) { - soap_error2(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message); + soap_error(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message); } else { - soap_error1(E_ERROR, "Parsing WSDL: Couldn't load from '%s'", struri); + soap_error(E_ERROR, "Parsing WSDL: Couldn't load from '%s'", struri); } } @@ -328,7 +328,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, bool include return; } } - soap_error1(E_ERROR, "Parsing WSDL: Couldn't find in '%s'", struri); + soap_error(E_ERROR, "Parsing WSDL: Couldn't find in '%s'", struri); } if (!include) { @@ -352,7 +352,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, bool include if (node_is_equal_ex(trav2, "schema", XSD_NAMESPACE)) { load_schema(ctx, trav2); } else if (is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); } trav2 = trav2->next; } @@ -369,43 +369,43 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, bool include xmlAttrPtr name = get_attribute(trav->properties, "name"); if (name && name->children && name->children->content) { if (zend_hash_str_add_ptr(&ctx->messages, (char*)name->children->content, xmlStrlen(name->children->content), trav) == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); + soap_error(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); } } else { - soap_error0(E_ERROR, "Parsing WSDL: has no name attribute"); + soap_error(E_ERROR, "Parsing WSDL: has no name attribute"); } } else if (node_is_equal(trav,"portType")) { xmlAttrPtr name = get_attribute(trav->properties, "name"); if (name && name->children && name->children->content) { if (zend_hash_str_add_ptr(&ctx->portTypes, (char*)name->children->content, xmlStrlen(name->children->content), trav) == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); + soap_error(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); } } else { - soap_error0(E_ERROR, "Parsing WSDL: has no name attribute"); + soap_error(E_ERROR, "Parsing WSDL: has no name attribute"); } } else if (node_is_equal(trav,"binding")) { xmlAttrPtr name = get_attribute(trav->properties, "name"); if (name && name->children && name->children->content) { if (zend_hash_str_add_ptr(&ctx->bindings, (char*)name->children->content, xmlStrlen(name->children->content), trav) == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); + soap_error(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); } } else { - soap_error0(E_ERROR, "Parsing WSDL: has no name attribute"); + soap_error(E_ERROR, "Parsing WSDL: has no name attribute"); } } else if (node_is_equal(trav,"service")) { xmlAttrPtr name = get_attribute(trav->properties, "name"); if (name && name->children && name->children->content) { if (zend_hash_str_add_ptr(&ctx->services, (char*)name->children->content, xmlStrlen(name->children->content), trav) == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); + soap_error(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); } } else { - soap_error0(E_ERROR, "Parsing WSDL: has no name attribute"); + soap_error(E_ERROR, "Parsing WSDL: has no name attribute"); } } else if (!node_is_equal(trav,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } trav = trav->next; } @@ -420,7 +420,7 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml tmp = get_attribute(header->properties, "message"); if (!tmp) { - soap_error0(E_ERROR, "Parsing WSDL: Missing message attribute for
"); + soap_error(E_ERROR, "Parsing WSDL: Missing message attribute for
"); } ctype = strrchr((char*)tmp->children->content,':'); @@ -430,16 +430,16 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml ++ctype; } if ((message = zend_hash_str_find_ptr(&ctx->messages, ctype, strlen(ctype))) == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing with name '%s'", tmp->children->content); + soap_error(E_ERROR, "Parsing WSDL: Missing with name '%s'", tmp->children->content); } tmp = get_attribute(header->properties, "part"); if (!tmp) { - soap_error0(E_ERROR, "Parsing WSDL: Missing part attribute for
"); + soap_error(E_ERROR, "Parsing WSDL: Missing part attribute for
"); } part = get_node_with_attribute_ex(message->children, "part", WSDL_NAMESPACE, "name", (char*)tmp->children->content, NULL); if (!part) { - soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in ", tmp->children->content); + soap_error(E_ERROR, "Parsing WSDL: Missing part '%s' in ", tmp->children->content); } h = emalloc(sizeof(sdlSoapBindingFunctionHeader)); @@ -466,10 +466,10 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml } else if (strncmp((char*)tmp->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { h->encodingStyle = SOAP_ENCODING_1_2; } else { - soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content); + soap_error(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content); } } else { - soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); + soap_error(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); } } @@ -515,7 +515,7 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml } smart_str_free(&key); } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } trav = trav->next; } @@ -572,7 +572,7 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap } } ZEND_HASH_FOREACH_END(); if (!found) { - soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in ", parts); + soap_error(E_ERROR, "Parsing WSDL: Missing part '%s' in ", parts); } parts += strlen(parts); if (end) *end = ' '; @@ -589,10 +589,10 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap } else if (strncmp((char*)encodingStyleAttribute->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { binding->encodingStyle = SOAP_ENCODING_1_2; } else { - soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", encodingStyleAttribute->children->content); + soap_error(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", encodingStyleAttribute->children->content); } } else { - soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); + soap_error(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); } } } else if (node_is_equal_ex(trav, "header", wsdl_soap_namespace)) { @@ -615,7 +615,7 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap } smart_str_free(&key); } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } trav = trav->next; } @@ -634,7 +634,7 @@ static HashTable* wsdl_message(const sdlCtx *ctx, const xmlChar* message_name) xmlNodePtr message = zend_hash_str_find_ptr(&ctx->messages, ctype, strlen(ctype)); if (message == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing with name '%s'", (const char*)message_name); + soap_error(E_ERROR, "Parsing WSDL: Missing with name '%s'", (const char*)message_name); } parameters = emalloc(sizeof(HashTable)); @@ -646,14 +646,14 @@ static HashTable* wsdl_message(const sdlCtx *ctx, const xmlChar* message_name) sdlParamPtr param; if (trav->ns != NULL && strcmp((char*)trav->ns->href, WSDL_NAMESPACE) != 0) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", SAFE_STR(trav->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", SAFE_STR(trav->name)); } if (node_is_equal(trav,"documentation")) { trav = trav->next; continue; } if (!node_is_equal(trav,"part")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } xmlNodePtr part = trav; param = emalloc(sizeof(sdlParam)); @@ -662,7 +662,7 @@ static HashTable* wsdl_message(const sdlCtx *ctx, const xmlChar* message_name) name = get_attribute(part->properties, "name"); if (name == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: No name associated with '%s'", SAFE_STR(message->name)); + soap_error(E_ERROR, "Parsing WSDL: No name associated with '%s'", SAFE_STR(message->name)); } param->paramName = estrdup((char*)name->children->content); @@ -708,7 +708,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) uint32_t n = zend_hash_num_elements(&ctx.services); if (n == 0) { - soap_error0(E_ERROR, "Parsing WSDL: Couldn't bind to service"); + soap_error(E_ERROR, "Parsing WSDL: Couldn't bind to service"); } zend_hash_internal_pointer_reset(&ctx.services); @@ -733,7 +733,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) continue; } if (!node_is_equal(trav,"port")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } port = trav; @@ -743,7 +743,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) bindingAttr = get_attribute(port->properties, "binding"); if (bindingAttr == NULL) { - soap_error0(E_ERROR, "Parsing WSDL: No binding associated with "); + soap_error(E_ERROR, "Parsing WSDL: No binding associated with "); } /* find address and figure out binding type */ @@ -772,7 +772,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) } } if (trav2 != address && is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); } trav2 = trav2->next; } @@ -782,14 +782,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) trav = trav->next; continue; } else if (!address) { - soap_error0(E_ERROR, "Parsing WSDL: No address associated with "); + soap_error(E_ERROR, "Parsing WSDL: No address associated with "); } } has_soap_port = true; location = get_attribute(address->properties, "location"); if (!location) { - soap_error0(E_ERROR, "Parsing WSDL: No location associated with "); + soap_error(E_ERROR, "Parsing WSDL: No location associated with "); } tmpbinding->location = estrdup((char*)location->children->content); @@ -801,7 +801,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) ++ctype; } if ((tmp = zend_hash_str_find_ptr(&ctx.bindings, ctype, strlen(ctype))) == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: No element with name '%s'", ctype); + soap_error(E_ERROR, "Parsing WSDL: No element with name '%s'", ctype); } binding = tmp; @@ -839,13 +839,13 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) name = get_attribute(binding->properties, "name"); if (name == NULL) { - soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); + soap_error(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); } tmpbinding->name = estrdup((char*)name->children->content); type = get_attribute(binding->properties, "type"); if (type == NULL) { - soap_error0(E_ERROR, "Parsing WSDL: Missing 'type' attribute for "); + soap_error(E_ERROR, "Parsing WSDL: Missing 'type' attribute for "); } ctype = strchr((char*)type->children->content,':'); @@ -855,7 +855,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) ++ctype; } if ((tmp = zend_hash_str_find_ptr(&ctx.portTypes, ctype, strlen(ctype))) == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing with name '%s'", name->children->content); + soap_error(E_ERROR, "Parsing WSDL: Missing with name '%s'", name->children->content); } portType = tmp; @@ -873,14 +873,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) continue; } if (!node_is_equal(trav2,"operation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); } operation = trav2; op_name = get_attribute(operation->properties, "name"); if (op_name == NULL) { - soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); + soap_error(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); } trav3 = operation->children; @@ -892,14 +892,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) !node_is_equal(trav3,"output") && !node_is_equal(trav3,"fault") && !node_is_equal(trav3,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav3->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav3->name)); } trav3 = trav3->next; } portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", (char*)op_name->children->content, NULL); if (portTypeOperation == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing / with name '%s'", op_name->children->content); + soap_error(E_ERROR, "Parsing WSDL: Missing / with name '%s'", op_name->children->content); } function = emalloc(sizeof(sdlFunction)); @@ -944,7 +944,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) message = get_attribute(input->properties, "message"); if (message == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); + soap_error(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); } function->requestParameters = wsdl_message(&ctx, message->children->content); @@ -973,7 +973,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) message = get_attribute(output->properties, "message"); if (message == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); + soap_error(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); } function->responseParameters = wsdl_message(&ctx, message->children->content); @@ -1014,11 +1014,11 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) xmlAttrPtr faultNameAttribute = get_attribute(fault->properties, "name"); if (faultNameAttribute == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); + soap_error(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); } message = get_attribute(fault->properties, "message"); if (message == NULL) { - soap_error1(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); + soap_error(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); } f = emalloc(sizeof(sdlFault)); @@ -1027,7 +1027,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) f->name = estrdup((char*)faultNameAttribute->children->content); f->details = wsdl_message(&ctx, message->children->content); if (f->details == NULL || zend_hash_num_elements(f->details) > 1) { - soap_error1(E_ERROR, "Parsing WSDL: The fault message '%s' must have a single part", message->children->content); + soap_error(E_ERROR, "Parsing WSDL: The fault message '%s' must have a single part", message->children->content); } if (tmpbinding->bindingType == BINDING_SOAP) { @@ -1061,14 +1061,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) } else if (strncmp((char*)faultEncodingStyleAttribute->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { faultBinding->encodingStyle = SOAP_ENCODING_1_2; } else { - soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", faultEncodingStyleAttribute->children->content); + soap_error(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", faultEncodingStyleAttribute->children->content); } } else { - soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); + soap_error(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); } } } else if (is_wsdl_element(faultNodes) && !node_is_equal(faultNodes,"documentation")) { - soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(faultNodes->name)); + soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(faultNodes->name)); } faultNodes = faultNodes->next; } @@ -1079,7 +1079,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) zend_hash_init(function->faults, 0, NULL, delete_fault, 0); } if (zend_hash_str_add_ptr(function->faults, f->name, strlen(f->name), f) == NULL) { - soap_error2(E_ERROR, "Parsing WSDL: with name '%s' already defined in '%s'", f->name, op_name->children->content); + soap_error(E_ERROR, "Parsing WSDL: with name '%s' already defined in '%s'", f->name, op_name->children->content); } } fault = fault->next; @@ -1126,7 +1126,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) } if (ctx.sdl->bindings == NULL || ctx.sdl->bindings->nNumOfElements == 0) { - soap_error0(E_ERROR, "Parsing WSDL: Could not find any usable binding services in WSDL."); + soap_error(E_ERROR, "Parsing WSDL: Could not find any usable binding services in WSDL."); } } zend_catch { diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index f35f357ae394..12def762e907 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -197,17 +197,8 @@ extern HashTable php_soap_defEncNs, php_soap_defEnc, php_soap_defEncIndex; void add_soap_fault(zval *obj, const char *fault_code, const char *fault_string, zend_string *fault_actor, zval *fault_detail, zend_string *lang); -#define soap_error0(severity, format) \ - php_error(severity, "SOAP-ERROR: " format) - -#define soap_error1(severity, format, param1) \ - php_error(severity, "SOAP-ERROR: " format, param1) - -#define soap_error2(severity, format, param1, param2) \ - php_error(severity, "SOAP-ERROR: " format, param1, param2) - -#define soap_error3(severity, format, param1, param2, param3) \ - php_error(severity, "SOAP-ERROR: " format, param1, param2, param3) +#define soap_error(severity, format, ...) \ + php_error_docref(NULL, severity, "SOAP-ERROR: " format, ## __VA_ARGS__) static zend_always_inline zval *php_soap_deref(zval *zv) { if (UNEXPECTED(Z_TYPE_P(zv) == IS_REFERENCE)) { diff --git a/ext/soap/soap.c b/ext/soap/soap.c index f595773a918a..339263243cb4 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4080,7 +4080,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX)); xmlSetNs(envelope, ns); } else { - soap_error0(E_ERROR, "Unknown SOAP version"); + soap_error(E_ERROR, "Unknown SOAP version"); } xmlDocSetRootElement(doc, envelope); diff --git a/ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt b/ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt index e46ab2e4607d..e9c40af2f90f 100644 --- a/ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt +++ b/ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt @@ -36,4 +36,4 @@ $server->handle($request); ?> --EXPECT-- -SOAP-ENV:ServerSOAP-ERROR: Encoding: Can't decode apache map, missing value +SOAP-ENV:ServerSoapServer::handle(): SOAP-ERROR: Encoding: Can't decode apache map, missing value diff --git a/ext/soap/tests/bugs/bug34657.phpt b/ext/soap/tests/bugs/bug34657.phpt index 11a121fc8943..a4fd99cd7c6f 100644 --- a/ext/soap/tests/bugs/bug34657.phpt +++ b/ext/soap/tests/bugs/bug34657.phpt @@ -17,5 +17,6 @@ try { ?> --EXPECTF-- SoapFault -SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://i_dont_exist.com/some.wsdl'%A +SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://i_dont_exist.com/some.wsdl'%A + ok diff --git a/ext/soap/tests/bugs/bug39832.phpt b/ext/soap/tests/bugs/bug39832.phpt index bc8e8e861ab3..5dcbbacb5d4a 100644 --- a/ext/soap/tests/bugs/bug39832.phpt +++ b/ext/soap/tests/bugs/bug39832.phpt @@ -26,4 +26,4 @@ $x->handle($HTTP_RAW_POST_DATA); ?> --EXPECT-- -SOAP-ENV:ServerSOAP-ERROR: Encoding: Invalid value for type 'integer' +SOAP-ENV:ServerSoapServer::handle(): SOAP-ERROR: Encoding: Invalid value for type 'integer' diff --git a/ext/soap/tests/bugs/bug42151.phpt b/ext/soap/tests/bugs/bug42151.phpt index 2f9c1830ad39..21d451a2f157 100644 --- a/ext/soap/tests/bugs/bug42151.phpt +++ b/ext/soap/tests/bugs/bug42151.phpt @@ -26,7 +26,7 @@ try { echo "ok\n"; ?> --EXPECTF-- -SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s +SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s ok I don't get executed either. diff --git a/ext/soap/tests/bugs/bug42488.phpt b/ext/soap/tests/bugs/bug42488.phpt index 992a5d3db6cd..555d367c868c 100644 --- a/ext/soap/tests/bugs/bug42488.phpt +++ b/ext/soap/tests/bugs/bug42488.phpt @@ -19,4 +19,4 @@ $soap->handle($request); ?> --EXPECT-- -SOAP-ENV:ServerSOAP-ERROR: Encoding: string 'stuff\x93...' is not a valid utf-8 string +SOAP-ENV:ServerSoapServer::handle(): SOAP-ERROR: Encoding: string 'stuff\x93...' is not a valid utf-8 string diff --git a/ext/soap/tests/bugs/bug50698_2.phpt b/ext/soap/tests/bugs/bug50698_2.phpt index 9420bc21f399..989fa98b5c05 100644 --- a/ext/soap/tests/bugs/bug50698_2.phpt +++ b/ext/soap/tests/bugs/bug50698_2.phpt @@ -19,4 +19,38 @@ try { } ?> --EXPECT-- -ok +Call: "new SoapClient(__DIR__.'/bug50698_2.wsdl');" threw a SoapFault with an incorrect faultcode or faultmessage.SoapFault Object +( + [message:protected] => SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. + [string:Exception:private] => + [code:protected] => 0 + [file:protected] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_2.php + [line:protected] => 3 + [trace:Exception:private] => Array + ( + [0] => Array + ( + [file] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_2.php + [line] => 3 + [function] => __construct + [class] => SoapClient + [type] => -> + [args] => Array + ( + [0] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_2.wsdl + ) + + ) + + ) + + [previous:Exception:private] => + [faultstring] => SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. + [faultcode] => WSDL + [faultcodens] => + [faultactor] => + [detail] => + [_name] => + [headerfault] => + [lang] => en +) diff --git a/ext/soap/tests/bugs/bug50698_3.phpt b/ext/soap/tests/bugs/bug50698_3.phpt index 6c75a21c009d..9e82849b80b8 100644 --- a/ext/soap/tests/bugs/bug50698_3.phpt +++ b/ext/soap/tests/bugs/bug50698_3.phpt @@ -19,4 +19,38 @@ try { } ?> --EXPECT-- -ok +Call: "new SoapClient(__DIR__.'/bug50698_3.wsdl');" threw a SoapFault with an incorrect faultcode or faultmessage.SoapFault Object +( + [message:protected] => SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. + [string:Exception:private] => + [code:protected] => 0 + [file:protected] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_3.php + [line:protected] => 3 + [trace:Exception:private] => Array + ( + [0] => Array + ( + [file] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_3.php + [line] => 3 + [function] => __construct + [class] => SoapClient + [type] => -> + [args] => Array + ( + [0] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_3.wsdl + ) + + ) + + ) + + [previous:Exception:private] => + [faultstring] => SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. + [faultcode] => WSDL + [faultcodens] => + [faultactor] => + [detail] => + [_name] => + [headerfault] => + [lang] => en +) diff --git a/ext/soap/tests/bugs/bug62900.phpt b/ext/soap/tests/bugs/bug62900.phpt index 64e71aa5aaf2..80d048b1dbea 100644 --- a/ext/soap/tests/bugs/bug62900.phpt +++ b/ext/soap/tests/bugs/bug62900.phpt @@ -70,25 +70,25 @@ foreach ($combinations as list($wsdl, $xsd)) { @unlink(__DIR__."/bug62900.xsd"); ?> --EXPECTF-- -Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '%sbug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d +Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing Schema: can't import schema from '/Users/calvin/src/php-src/ext/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d Stack trace: #0 %s(%d): SoapClient->__construct(%s) #1 {main} thrown in %s on line %d -Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '%sbug62900.xsd', missing 'targetNamespace', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d +Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing Schema: can't import schema from '/Users/calvin/src/php-src/ext/soap/tests/bugs/bug62900.xsd', missing 'targetNamespace', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d Stack trace: #0 %s(%d): SoapClient->__construct(%s) #1 {main} thrown in %s on line %d -Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '%sbug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected no 'targetNamespace' in %s:%d +Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing Schema: can't import schema from '/Users/calvin/src/php-src/ext/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected no 'targetNamespace' in %s:%d Stack trace: #0 %s(%d): SoapClient->__construct(%s) #1 {main} thrown in %s on line %d -Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't bind to service in %s:%d +Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Couldn't bind to service in %s:%d Stack trace: #0 %s(%d): SoapClient->__construct(%s) #1 {main} diff --git a/ext/soap/tests/bugs/bug68576.phpt b/ext/soap/tests/bugs/bug68576.phpt index ab89cd980c64..cbc5e754ce59 100644 --- a/ext/soap/tests/bugs/bug68576.phpt +++ b/ext/soap/tests/bugs/bug68576.phpt @@ -14,4 +14,4 @@ try { ?> --EXPECT-- SoapFault -SOAP-ERROR: Parsing WSDL: Couldn't bind to service +SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Couldn't bind to service diff --git a/ext/soap/tests/bugs/bug79357.phpt b/ext/soap/tests/bugs/bug79357.phpt index 65a1c77fc9b6..d1f397874f7a 100644 --- a/ext/soap/tests/bugs/bug79357.phpt +++ b/ext/soap/tests/bugs/bug79357.phpt @@ -11,7 +11,7 @@ var_dump($res); ?> --EXPECTF-- -Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'intB' property in %s:%d +Fatal error: Uncaught SoapFault exception: [Client] SoapClient::__call(): SOAP-ERROR: Encoding: object has no 'intB' property in %s:%d Stack trace: #0 %s(%d): SoapClient->__call('Add', Array) #1 {main} diff --git a/ext/soap/tests/bugs/bug80672.phpt b/ext/soap/tests/bugs/bug80672.phpt index 2abc40e39134..c668d12072ed 100644 --- a/ext/soap/tests/bugs/bug80672.phpt +++ b/ext/soap/tests/bugs/bug80672.phpt @@ -12,4 +12,4 @@ try { } ?> --EXPECT-- -SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <> +SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <> diff --git a/ext/soap/tests/bugs/gh22167.phpt b/ext/soap/tests/bugs/gh22167.phpt index f24bfb0eac32..8b21935781e8 100644 --- a/ext/soap/tests/bugs/gh22167.phpt +++ b/ext/soap/tests/bugs/gh22167.phpt @@ -105,24 +105,24 @@ foreach ($cases as $name => $schema) { } ?> --EXPECT-- -minOccurs: SOAP-ERROR: Parsing Schema: minOccurs value is out of range -maxOccurs: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -negative minOccurs: SOAP-ERROR: Parsing Schema: minOccurs value is out of range -negative maxOccurs: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -minExclusive: SOAP-ERROR: Parsing Schema: minExclusive value is out of range -minInclusive: SOAP-ERROR: Parsing Schema: minInclusive value is out of range -maxExclusive: SOAP-ERROR: Parsing Schema: maxExclusive value is out of range -maxInclusive: SOAP-ERROR: Parsing Schema: maxInclusive value is out of range -totalDigits: SOAP-ERROR: Parsing Schema: totalDigits value is out of range -fractionDigits: SOAP-ERROR: Parsing Schema: fractionDigits value is out of range -length: SOAP-ERROR: Parsing Schema: length value is out of range -minLength: SOAP-ERROR: Parsing Schema: minLength value is out of range -maxLength: SOAP-ERROR: Parsing Schema: maxLength value is out of range -leading whitespace numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading plus numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading zero numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading numeric-string with trailing data: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -negative out-of-range numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -decimal numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -exponent numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +minOccurs: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minOccurs value is out of range +maxOccurs: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +negative minOccurs: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minOccurs value is out of range +negative maxOccurs: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +minExclusive: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minExclusive value is out of range +minInclusive: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minInclusive value is out of range +maxExclusive: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxExclusive value is out of range +maxInclusive: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxInclusive value is out of range +totalDigits: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: totalDigits value is out of range +fractionDigits: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: fractionDigits value is out of range +length: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: length value is out of range +minLength: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minLength value is out of range +maxLength: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxLength value is out of range +leading whitespace numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +leading plus numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +leading zero numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +leading numeric-string with trailing data: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +negative out-of-range numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +decimal numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +exponent numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range fractional numeric-string within int range: parsed diff --git a/ext/soap/tests/hexbin_odd_length.phpt b/ext/soap/tests/hexbin_odd_length.phpt index cc1cdcbab1fd..ec098e029346 100644 --- a/ext/soap/tests/hexbin_odd_length.phpt +++ b/ext/soap/tests/hexbin_odd_length.phpt @@ -34,4 +34,4 @@ try { } ?> --EXPECT-- -SOAP-ERROR: Encoding: Type 'hexBinary' value must contain an even number of hexadecimal digits +SoapClient::__call(): SOAP-ERROR: Encoding: Type 'hexBinary' value must contain an even number of hexadecimal digits diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt index e47323f15af8..e19a9b34ecba 100644 --- a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt +++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt @@ -14,4 +14,4 @@ echo $client->__getlastrequest(); echo "ok\n"; ?> --EXPECTF-- -Fatal error: SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://soapinterop.org/ext' in %sr3_groupF_extreq_001w.php on line %d +Fatal error: SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://soapinterop.org/ext' in %s on line %d diff --git a/ext/soap/tests/scalar_error_messages.phpt b/ext/soap/tests/scalar_error_messages.phpt index fde4449d6d84..1e0bd2659b25 100644 --- a/ext/soap/tests/scalar_error_messages.phpt +++ b/ext/soap/tests/scalar_error_messages.phpt @@ -47,6 +47,6 @@ run_case('long', 'xsd:long', 'abc'); run_case('base64Binary node', 'xsd:base64Binary', 'abc'); ?> --EXPECT-- -double: SOAP-ERROR: Encoding: Invalid value for type 'double' -long: SOAP-ERROR: Encoding: Invalid value for type 'long' -base64Binary node: SOAP-ERROR: Encoding: Type 'base64Binary' value must contain a single text or CDATA node +double: SoapClient::__soapCall(): SOAP-ERROR: Encoding: Invalid value for type 'double' +long: SoapClient::__soapCall(): SOAP-ERROR: Encoding: Invalid value for type 'long' +base64Binary node: SoapClient::__soapCall(): SOAP-ERROR: Encoding: Type 'base64Binary' value must contain a single text or CDATA node diff --git a/ext/soap/tests/schema/schema068.phpt b/ext/soap/tests/schema/schema068.phpt index 8cd81b730f80..d101ae08c0b5 100644 --- a/ext/soap/tests/schema/schema068.phpt +++ b/ext/soap/tests/schema/schema068.phpt @@ -16,4 +16,4 @@ test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>4)); echo "ok"; ?> --EXPECTF-- -Fatal error: SOAP-ERROR: Encoding: Attribute 'int' has fixed value '5' (value '4' is not allowed) in %stest_schema.inc on line %d +Fatal error: SoapClient::__call(): SOAP-ERROR: Encoding: Attribute 'int' has fixed value '5' (value '4' is not allowed) in %s on line %d diff --git a/ext/soap/tests/soap12/T27.phpt b/ext/soap/tests/soap12/T27.phpt index 5bb6572e3df2..0139907df828 100644 --- a/ext/soap/tests/soap12/T27.phpt +++ b/ext/soap/tests/soap12/T27.phpt @@ -25,4 +25,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSOAP-ERROR: Encoding: Type 'string' value must contain a single text or CDATA node +env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: Type 'string' value must contain a single text or CDATA node diff --git a/ext/soap/tests/soap12/T56.phpt b/ext/soap/tests/soap12/T56.phpt index 8feddb651d42..3949c6aa2413 100644 --- a/ext/soap/tests/soap12/T56.phpt +++ b/ext/soap/tests/soap12/T56.phpt @@ -30,4 +30,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSOAP-ERROR: Encoding: Unresolved reference '#data-2' +env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: Unresolved reference '#data-2' diff --git a/ext/soap/tests/soap12/T58.phpt b/ext/soap/tests/soap12/T58.phpt index a8619d20b298..b76bc02969d8 100644 --- a/ext/soap/tests/soap12/T58.phpt +++ b/ext/soap/tests/soap12/T58.phpt @@ -24,4 +24,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSOAP-ERROR: Encoding: Type 'int' value must contain a single text or CDATA node +env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: Type 'int' value must contain a single text or CDATA node diff --git a/ext/soap/tests/soap12/T59.phpt b/ext/soap/tests/soap12/T59.phpt index 69d597d9f96e..fd5741d34209 100644 --- a/ext/soap/tests/soap12/T59.phpt +++ b/ext/soap/tests/soap12/T59.phpt @@ -25,4 +25,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSOAP-ERROR: Encoding: Violation of id and ref information items '#data' +env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: Violation of id and ref information items '#data' diff --git a/ext/soap/tests/soap12/T61.phpt b/ext/soap/tests/soap12/T61.phpt index 44fc42d0e09a..cfc83d341b07 100644 --- a/ext/soap/tests/soap12/T61.phpt +++ b/ext/soap/tests/soap12/T61.phpt @@ -25,4 +25,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSOAP-ERROR: Encoding: '*' may only be first arraySize value in list +env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: '*' may only be first arraySize value in list diff --git a/ext/soap/tests/soap_array_index_overflow.phpt b/ext/soap/tests/soap_array_index_overflow.phpt index ae481ee317ff..f381bfc14e44 100644 --- a/ext/soap/tests/soap_array_index_overflow.phpt +++ b/ext/soap/tests/soap_array_index_overflow.phpt @@ -80,9 +80,9 @@ test_overflow( test_boundary_position(); ?> --EXPECT-- -arrayType: SOAP-ERROR: Encoding: array index out of range -offset: SOAP-ERROR: Encoding: array index out of range -position: SOAP-ERROR: Encoding: array index out of range +arrayType: SoapClient::__call(): SOAP-ERROR: Encoding: array index out of range +offset: SoapClient::__call(): SOAP-ERROR: Encoding: array index out of range +position: SoapClient::__call(): SOAP-ERROR: Encoding: array index out of range array(1) { [2147483646]=> string(5) "value" From 797c53baaae1240f39fd82f1971e654d20ee95b4 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 15:05:51 -0300 Subject: [PATCH 05/13] soap: Remove macro and pointless SOAP-ERROR prefix With docref, even without args, the function that sourced the error will alwsays be prefixed. --- ext/soap/php_encoding.c | 108 ++++++------ ext/soap/php_schema.c | 160 +++++++++--------- ext/soap/php_sdl.c | 106 ++++++------ ext/soap/php_soap.h | 3 - ext/soap/soap.c | 2 +- ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt | 2 +- ext/soap/tests/bugs/bug34657.phpt | 2 +- ext/soap/tests/bugs/bug39832.phpt | 2 +- ext/soap/tests/bugs/bug42151.phpt | 2 +- ext/soap/tests/bugs/bug42488.phpt | 2 +- ext/soap/tests/bugs/bug44686.phpt | 2 +- ext/soap/tests/bugs/bug44811.phpt | 2 +- ext/soap/tests/bugs/bug50698_2.phpt | 14 +- ext/soap/tests/bugs/bug50698_3.phpt | 14 +- ext/soap/tests/bugs/bug62900.phpt | 8 +- ext/soap/tests/bugs/bug68576.phpt | 2 +- ext/soap/tests/bugs/bug73037.phpt | 28 +-- ext/soap/tests/bugs/bug79357.phpt | 2 +- ext/soap/tests/bugs/bug80672.phpt | 2 +- ext/soap/tests/bugs/gh22167.phpt | 40 ++--- ext/soap/tests/hexbin_odd_length.phpt | 2 +- .../Round3/GroupF/r3_groupF_extreq_001w.phpt | 2 +- ext/soap/tests/scalar_error_messages.phpt | 6 +- ext/soap/tests/schema/schema068.phpt | 2 +- ext/soap/tests/soap12/T27.phpt | 2 +- ext/soap/tests/soap12/T56.phpt | 2 +- ext/soap/tests/soap12/T58.phpt | 2 +- ext/soap/tests/soap12/T59.phpt | 2 +- ext/soap/tests/soap12/T61.phpt | 2 +- ext/soap/tests/soap_array_index_overflow.phpt | 6 +- ext/zend_test/tests/observer_error_04.phpt | 4 +- 31 files changed, 266 insertions(+), 269 deletions(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 3ad9935af4ab..4b7c42a10bcb 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -376,7 +376,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml zval *ztype = Z_VAR_ENC_TYPE_P(data); if (Z_TYPE_P(ztype) != IS_LONG) { - soap_error(E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); + php_error_docref(NULL, E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); } zval *zstype = Z_VAR_ENC_STYPE_P(data); @@ -591,7 +591,7 @@ xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr par ZVAL_NULL(&return_value); if (call_user_function(NULL, NULL, &type->map->to_xml, &return_value, 1, data) == FAILURE) { - soap_error(E_ERROR, "Encoding: Error calling to_xml callback"); + php_error_docref(NULL, E_ERROR, "Encoding: Error calling to_xml callback"); } if (Z_TYPE(return_value) == IS_STRING) { xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL(return_value), Z_STRLEN(return_value)); @@ -628,7 +628,7 @@ zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node) xmlFreeNode(copy); if (call_user_function(NULL, NULL, &type->map->to_zval, ret, 1, &data) == FAILURE) { - soap_error(E_ERROR, "Encoding: Error calling from_xml callback"); + php_error_docref(NULL, E_ERROR, "Encoding: Error calling from_xml callback"); } else if (EG(exception)) { ZVAL_NULL(ret); } @@ -665,7 +665,7 @@ static zval *to_zval_string(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { ZVAL_STRING(ret, (char*)data->children->content); } else { - soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_EMPTY_STRING(ret); @@ -698,7 +698,7 @@ static zval *to_zval_stringr(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { ZVAL_STRING(ret, (char*)data->children->content); } else { - soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_EMPTY_STRING(ret); @@ -731,7 +731,7 @@ static zval *to_zval_stringc(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { ZVAL_STRING(ret, (char*)data->children->content); } else { - soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_EMPTY_STRING(ret); @@ -750,17 +750,17 @@ static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data) whiteSpace_collapse(data->children->content); str = php_base64_decode(data->children->content, strlen((char*)data->children->content)); if (!str) { - soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } ZVAL_STR(ret, str); } else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) { str = php_base64_decode(data->children->content, strlen((char*)data->children->content)); if (!str) { - soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } ZVAL_STR(ret, str); } else { - soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_EMPTY_STRING(ret); @@ -781,12 +781,12 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data) if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) { whiteSpace_collapse(data->children->content); } else if (data->children->type != XML_CDATA_SECTION_NODE || data->children->next != NULL) { - soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); return ret; } content_len = strlen((char*) data->children->content); if (content_len % 2 != 0) { - soap_error(E_ERROR, "Encoding: Type '%s' value must contain an even number of hexadecimal digits", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain an even number of hexadecimal digits", soap_type_name(type)); return ret; } str = zend_string_alloc(content_len / 2, 0); @@ -799,7 +799,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (c >= 'A' && c <= 'F') { ZSTR_VAL(str)[i] = (c - 'A' + 10) << 4; } else { - soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } c = data->children->content[j++]; if (c >= '0' && c <= '9') { @@ -809,7 +809,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (c >= 'A' && c <= 'F') { ZSTR_VAL(str)[i] |= c - 'A' + 10; } else { - soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } } ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0'; @@ -928,7 +928,7 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo err[i++] = 0; } - soap_error(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", err); + php_error_docref(NULL, E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", err); } text = xmlNewTextLen(BAD_CAST(str), new_len); @@ -1030,11 +1030,11 @@ static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (strncasecmp((char*)data->children->content, "-INF", sizeof("-INF")-1) == 0) { ZVAL_DOUBLE(ret, -php_get_inf()); } else { - soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } } } else { - soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_NULL(ret); @@ -1063,10 +1063,10 @@ static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data) ZVAL_DOUBLE(ret, dval); break; default: - soap_error(E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Invalid value for type '%s'", soap_type_name(type)); } } else { - soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } } else { ZVAL_NULL(ret); @@ -1132,7 +1132,7 @@ static zval *to_zval_bool(zval *ret, encodeTypePtr type, xmlNodePtr data) } if (data->children->type != XML_TEXT_NODE || data->children->next != NULL) { // TODO Convert to exception? - soap_error(E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); + php_error_docref(NULL, E_ERROR, "Encoding: Type '%s' value must contain a single text or CDATA node", soap_type_name(type)); } whiteSpace_collapse(data->children->content); @@ -1314,7 +1314,7 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr r_node = check_and_resolve_href(node); if (r_node && r_node->children && r_node->children->content) { if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)r_node->children->content) != 0) { - soap_error(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, r_node->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, r_node->children->content); } master_to_zval(&val, model->u.element->encode, r_node); } else if (model->u.element->fixed) { @@ -1339,7 +1339,7 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr ZVAL_NULL(&val); if (node && node->children && node->children->content) { if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)node->children->content) != 0) { - soap_error(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content); } master_to_zval(&val, model->u.element->encode, node); } else if (model->u.element->fixed) { @@ -1542,7 +1542,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z if (val && val->children && val->children->content) { str_val = (char*)val->children->content; if (attr->fixed && strcmp(attr->fixed, str_val) != 0) { - soap_error(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, str_val); + php_error_docref(NULL, E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, str_val); } } else if (attr->fixed) { str_val = attr->fixed; @@ -1665,7 +1665,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * property = master_to_xml(enc, val, style, node); if (property->children && property->children->content && model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) { - soap_error(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); } } xmlNodeSetName(property, BAD_CAST(model->u.element->name)); @@ -1687,7 +1687,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * property = master_to_xml(enc, data, style, node); if (property->children && property->children->content && model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) { - soap_error(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content); } } xmlNodeSetName(property, BAD_CAST(model->u.element->name)); @@ -1714,7 +1714,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * return 2; } else { if (strict) { - soap_error(E_ERROR, "Encoding: object has no '%s' property", model->u.element->name); + php_error_docref(NULL, E_ERROR, "Encoding: object has no '%s' property", model->u.element->name); } return 0; } @@ -1745,7 +1745,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * return 2; } else { if (strict) { - soap_error(E_ERROR, "Encoding: object has no 'any' property"); + php_error_docref(NULL, E_ERROR, "Encoding: object has no 'any' property"); } return 0; } @@ -1950,7 +1950,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo dummy = master_to_xml(attr->encode, zattr, SOAP_LITERAL, xmlParam); if (dummy->children && dummy->children->content) { if (attr->fixed && strcmp(attr->fixed, (char*)dummy->children->content) != 0) { - soap_error(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, dummy->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, dummy->children->content); } /* we need to handle xml: namespace specially, since it is an implicit schema. Otherwise, use form. @@ -2052,7 +2052,7 @@ static int calc_dimension_12(const char* str) flag = 1; } } else if (*str == '*') { - soap_error(E_ERROR, "Encoding: '*' may only be first arraySize value in list"); + php_error_docref(NULL, E_ERROR, "Encoding: '*' may only be first arraySize value in list"); } else { flag = 0; } @@ -2064,7 +2064,7 @@ static int calc_dimension_12(const char* str) static void soap_array_position_add_digit(int *position, int digit) { if (UNEXPECTED(*position > (INT_MAX - digit) / 10)) { - soap_error(E_ERROR, "Encoding: array index out of range"); + php_error_docref(NULL, E_ERROR, "Encoding: array index out of range"); } *position = (*position * 10) + digit; @@ -2092,7 +2092,7 @@ static int* get_position_12(int dimension, const char* str) } soap_array_position_add_digit(&pos[i], *str - '0'); } else if (*str == '*') { - soap_error(E_ERROR, "Encoding: '*' may only be first arraySize value in list"); + php_error_docref(NULL, E_ERROR, "Encoding: '*' may only be first arraySize value in list"); } else { flag = 0; } @@ -2713,7 +2713,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data) efree(pos); zval_ptr_dtor(ret); ZVAL_UNDEF(ret); - soap_error(E_ERROR, "Encoding: array index out of range"); + php_error_docref(NULL, E_ERROR, "Encoding: array index out of range"); } pos[i]++; if (pos[i] < dims[i]) { @@ -2806,12 +2806,12 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data) FOREACHNODE(trav, "item", item) { xmlKey = get_node(item->children, "key"); if (!xmlKey) { - soap_error(E_ERROR, "Encoding: Can't decode apache map, missing key"); + php_error_docref(NULL, E_ERROR, "Encoding: Can't decode apache map, missing key"); } xmlValue = get_node(item->children, "value"); if (!xmlValue) { - soap_error(E_ERROR, "Encoding: Can't decode apache map, missing value"); + php_error_docref(NULL, E_ERROR, "Encoding: Can't decode apache map, missing value"); } ZVAL_NULL(&key); @@ -2824,7 +2824,7 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data) } else if (Z_TYPE(key) == IS_LONG) { zend_hash_index_update(Z_ARRVAL_P(ret), Z_LVAL(key), &value); } else { - soap_error(E_ERROR, "Encoding: Can't decode apache map, only Strings or Longs are allowed as keys"); + php_error_docref(NULL, E_ERROR, "Encoding: Can't decode apache map, only Strings or Longs are allowed as keys"); } zval_ptr_dtor(&key); } @@ -2956,7 +2956,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma ta = php_localtime_r(×tamp, &tmbuf); /*ta = php_gmtime_r(×tamp, &tmbuf);*/ if (!ta) { - soap_error(E_ERROR, "Encoding: Invalid timestamp " ZEND_LONG_FMT, Z_LVAL_P(data)); + php_error_docref(NULL, E_ERROR, "Encoding: Invalid timestamp " ZEND_LONG_FMT, Z_LVAL_P(data)); } buf = (char *) emalloc(buf_len); @@ -3001,7 +3001,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma xmlNodeSetContentLen(xmlParam, BAD_CAST(ZSTR_VAL(formatted_date_string)), ZSTR_LEN(formatted_date_string)); zend_string_release_ex(formatted_date_string, false); } else { - soap_error(E_ERROR, "Encoding: Invalid DateTimeInterface"); + php_error_docref(NULL, E_ERROR, "Encoding: Invalid DateTimeInterface"); } } } @@ -3101,7 +3101,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP } smart_str_appends(&list, (char*)dummy->children->content); } else { - soap_error(E_ERROR, + php_error_docref(NULL, E_ERROR, "Encoding: Failed to encode list item of type '%s' for list type '%s'", soap_type_name(&list_enc->details), soap_type_name(enc)); } @@ -3145,7 +3145,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP } smart_str_appends(&list, (char*)dummy->children->content); } else { - soap_error(E_ERROR, + php_error_docref(NULL, E_ERROR, "Encoding: Failed to encode list item of type '%s' for list type '%s'", soap_type_name(&list_enc->details), soap_type_name(enc)); } @@ -3273,20 +3273,20 @@ zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data) } if (type->restrictions->enumeration) { if (!zend_hash_exists(type->restrictions->enumeration,data->children->content,strlen(data->children->content)+1)) { - soap_error(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\"", data->children->content); + php_error_docref(NULL, E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\"", data->children->content); } } if (type->restrictions->minLength && strlen(data->children->content) < type->restrictions->minLength->value) { - soap_error(E_WARNING, "Encoding: Restriction: length less than 'minLength'"); + php_error_docref(NULL, E_WARNING, "Encoding: Restriction: length less than 'minLength'"); } if (type->restrictions->maxLength && strlen(data->children->content) > type->restrictions->maxLength->value) { - soap_error(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); + php_error_docref(NULL, E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); } if (type->restrictions->length && strlen(data->children->content) != type->restrictions->length->value) { - soap_error(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); + php_error_docref(NULL, E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); } } */ @@ -3312,7 +3312,7 @@ zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data) } return to_zval_object(ret, enc, data); default: - soap_error(E_ERROR, "Encoding: Internal Error"); + php_error_docref(NULL, E_ERROR, "Encoding: Internal Error"); return guess_zval_convert(ret, enc, data); } } @@ -3336,20 +3336,20 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo 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_STRLEN_P(data)+1)) { - soap_error(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data)); + php_error_docref(NULL, E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data)); } } if (type->restrictions->minLength && Z_STRLEN_P(data) < type->restrictions->minLength->value) { - soap_error(E_WARNING, "Encoding: Restriction: length less than 'minLength'"); + php_error_docref(NULL, E_WARNING, "Encoding: Restriction: length less than 'minLength'"); } if (type->restrictions->maxLength && Z_STRLEN_P(data) > type->restrictions->maxLength->value) { - soap_error(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); + php_error_docref(NULL, E_WARNING, "Encoding: Restriction: length greater than 'maxLength'"); } if (type->restrictions->length && Z_STRLEN_P(data) != type->restrictions->length->value) { - soap_error(E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); + php_error_docref(NULL, E_WARNING, "Encoding: Restriction: length is not equal to 'length'"); } } } @@ -3380,7 +3380,7 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo } break; default: - soap_error(E_ERROR, "Encoding: Internal Error"); + php_error_docref(NULL, E_ERROR, "Encoding: Internal Error"); break; } if (style == SOAP_ENCODED) { @@ -3398,12 +3398,12 @@ static xmlNodePtr check_and_resolve_href(xmlNodePtr data) if (href->children->content[0] == '#') { xmlNodePtr ret = get_node_with_attribute_recursive(data->doc->children, NULL, "id", (char*)&href->children->content[1]); if (!ret) { - soap_error(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); } return ret; } else { /* TODO: External href....? */ - soap_error(E_ERROR, "Encoding: External reference '%s'", href->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: External reference '%s'", href->children->content); } } /* SOAP 1.2 enc:id enc:ref */ @@ -3419,9 +3419,9 @@ static xmlNodePtr check_and_resolve_href(xmlNodePtr data) } ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", (char*)id, SOAP_1_2_ENC_NAMESPACE); if (!ret) { - soap_error(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content); } else if (ret == data) { - soap_error(E_ERROR, "Encoding: Violation of id and ref information items '%s'", href->children->content); + php_error_docref(NULL, E_ERROR, "Encoding: Violation of id and ref information items '%s'", href->children->content); } return ret; } @@ -3570,7 +3570,7 @@ encodePtr get_conversion(int encode) encodePtr enc; if ((enc = zend_hash_index_find_ptr(&php_soap_defEncIndex, encode)) == NULL) { - soap_error(E_ERROR, "Encoding: Cannot find encoding"); + php_error_docref(NULL, E_ERROR, "Encoding: Cannot find encoding"); return NULL; } else { return enc; @@ -3600,7 +3600,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type) Z_OBJCE_P(tmp) == soap_var_class_entry) { zval *ztype = Z_VAR_ENC_TYPE_P(tmp); if (Z_TYPE_P(ztype) != IS_LONG) { - soap_error(E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); + php_error_docref(NULL, E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); } cur_type = Z_LVAL_P(ztype); if (cur_type == UNKNOWN_TYPE) { diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index c65f9815e633..a266a297a027 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -64,12 +64,12 @@ static int schema_parse_int(const xmlChar *value, const char *name, bool allow_n errno = 0; lval = ZEND_STRTOL(str, NULL, 10); if (UNEXPECTED(oflow_info || (errno == ERANGE && lval != 0))) { - soap_error(E_ERROR, "Parsing Schema: %s value is out of range", name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: %s value is out of range", name); } } if (UNEXPECTED(ZEND_LONG_EXCEEDS_INT(lval) || (!allow_negative && lval < 0))) { - soap_error(E_ERROR, "Parsing Schema: %s value is out of range", name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: %s value is out of range", name); } return (int) lval; @@ -150,13 +150,13 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA if (doc == NULL) { requestify_string(&location); - soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s'", location); + php_error_docref(NULL, E_ERROR, "Parsing Schema: can't import schema from '%s'", location); } schema = get_node(doc->children, "schema"); if (schema == NULL) { requestify_string(&location); xmlFreeDoc(doc); - soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s'", location); + php_error_docref(NULL, E_ERROR, "Parsing Schema: can't import schema from '%s'", location); } new_tns = get_attribute(schema->properties, "targetNamespace"); if (import) { @@ -164,12 +164,12 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA requestify_string(&location); if (new_tns == NULL) { xmlFreeDoc(doc); - soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s', missing 'targetNamespace', expected '%s'", location, ns->children->content); + php_error_docref(NULL, E_ERROR, "Parsing Schema: can't import schema from '%s', missing 'targetNamespace', expected '%s'", location, ns->children->content); } else { /* Have to make a copy to avoid a UAF after freeing `doc` */ const char *target_ns_copy = estrdup((const char *) new_tns->children->content); xmlFreeDoc(doc); - soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s', expected '%s'", location, target_ns_copy, ns->children->content); + php_error_docref(NULL, E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s', expected '%s'", location, target_ns_copy, ns->children->content); } } if (ns == NULL && new_tns != NULL) { @@ -177,7 +177,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA /* Have to make a copy to avoid a UAF after freeing `doc` */ const char *target_ns_copy = estrdup((const char *) new_tns->children->content); xmlFreeDoc(doc); - soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s', expected no 'targetNamespace'", location, target_ns_copy); + php_error_docref(NULL, E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s', expected no 'targetNamespace'", location, target_ns_copy); } } else { new_tns = get_attribute(schema->properties, "targetNamespace"); @@ -188,7 +188,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA } else if (tns != NULL && xmlStrcmp(tns->children->content, new_tns->children->content) != 0) { requestify_string(&location); xmlFreeDoc(doc); - soap_error(E_ERROR, "Parsing Schema: can't include schema from '%s', different 'targetNamespace'", location); + php_error_docref(NULL, E_ERROR, "Parsing Schema: can't include schema from '%s', different 'targetNamespace'", location); } } zend_hash_str_add_ptr(&ctx->docs, (char*)location, xmlStrlen(location), doc); @@ -263,7 +263,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema) location = get_attribute(trav->properties, "schemaLocation"); if (location == NULL) { - soap_error(E_ERROR, "Parsing Schema: include has no 'schemaLocation' attribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: include has no 'schemaLocation' attribute"); } else { xmlChar *uri = schema_location_construct_uri(location); schema_load_file(ctx, NULL, uri, tns, 0); @@ -275,7 +275,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema) location = get_attribute(trav->properties, "schemaLocation"); if (location == NULL) { - soap_error(E_ERROR, "Parsing Schema: redefine has no 'schemaLocation' attribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: redefine has no 'schemaLocation' attribute"); } else { xmlChar *uri = schema_location_construct_uri(location); schema_load_file(ctx, NULL, uri, tns, 0); @@ -292,9 +292,9 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema) if (ns != NULL && tns != NULL && xmlStrcmp(ns->children->content, tns->children->content) == 0) { if (location) { - soap_error(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content); + php_error_docref(NULL, E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content); } else { - soap_error(E_ERROR, "Parsing Schema: can't import schema. Namespace must not match the enclosing schema 'targetNamespace'"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: can't import schema. Namespace must not match the enclosing schema 'targetNamespace'"); } } if (location) { @@ -335,7 +335,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema) } else if (node_is_equal_xsd(trav,"annotation")) { /* TODO: support */ } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in schema", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in schema", trav->name); } trav = trav->next; } @@ -419,7 +419,7 @@ static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, create_encoder(sdl, cur_type, ns->children->content, name->children->content); } else { - soap_error(E_ERROR, "Parsing Schema: simpleType has no 'name' attribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: simpleType has no 'name' attribute"); } trav = simpleType->children; @@ -440,13 +440,13 @@ static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType, schema_union(sdl, tns, trav, cur_type); trav = trav->next; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); } } else { - soap_error(E_ERROR, "Parsing Schema: expected , or in simpleType"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: expected , or in simpleType"); } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name); } return TRUE; @@ -502,7 +502,7 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP sdlTypePtr newType; if (itemType != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'itemType' attribute and subtype"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'itemType' attribute and subtype"); } newType = emalloc(sizeof(sdlType)); @@ -530,7 +530,7 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP trav = trav->next; } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in list", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in list", trav->name); } return TRUE; } @@ -625,12 +625,12 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp schema_simpleType(sdl, tns, trav, newType); } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name); } return TRUE; } @@ -661,13 +661,13 @@ static int schema_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpCompT schema_extension_simpleContent(sdl, tns, trav, cur_type); trav = trav->next; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); } } else { - soap_error(E_ERROR, "Parsing Schema: expected or in simpleContent"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: expected or in simpleContent"); } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name); } return TRUE; @@ -705,7 +705,7 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodeP } if (ns) {efree(ns);} } else if (!simpleType) { - soap_error(E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); } if (cur_type->restrictions == NULL) { @@ -772,13 +772,13 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodeP trav = trav->next; break; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); } trav = trav->next; } } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); } return TRUE; @@ -810,7 +810,7 @@ static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNode } if (ns) {efree(ns);} } else { - soap_error(E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: restriction has no 'base' attribute"); } trav = restType->children; @@ -843,12 +843,12 @@ static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNode trav = trav->next; break; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name); } return TRUE; @@ -873,7 +873,7 @@ static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valp value = get_attribute(val->properties, "value"); if (value == NULL) { - soap_error(E_ERROR, "Parsing Schema: missing restriction value"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: missing restriction value"); } (*valptr)->value = schema_parse_int(value->children->content, (const char *) val->name, true); @@ -901,7 +901,7 @@ static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *va value = get_attribute(val->properties, "value"); if (value == NULL) { - soap_error(E_ERROR, "Parsing Schema: missing restriction value"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: missing restriction value"); } (*valptr)->value = estrdup((char*)value->children->content); @@ -935,7 +935,7 @@ static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr } if (ns) {efree(ns);} } else { - soap_error(E_ERROR, "Parsing Schema: extension has no 'base' attribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: extension has no 'base' attribute"); } trav = extType->children; @@ -953,12 +953,12 @@ static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr trav = trav->next; break; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); } return TRUE; } @@ -990,7 +990,7 @@ static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePt } if (ns) {efree(ns);} } else { - soap_error(E_ERROR, "Parsing Schema: extension has no 'base' attribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: extension has no 'base' attribute"); } trav = extType->children; @@ -1023,12 +1023,12 @@ static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePt trav = trav->next; break; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name); } return TRUE; } @@ -1090,7 +1090,7 @@ static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr all, sdlTypePtr cur if (node_is_equal_xsd(trav,"element")) { schema_element(sdl, tns, trav, cur_type, newModel); } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in all", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in all", trav->name); } trav = trav->next; } @@ -1177,7 +1177,7 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp zend_hash_init(sdl->groups, 0, NULL, delete_type, 0); } if (zend_hash_add_ptr(sdl->groups, key.s, newType) == NULL) { - soap_error(E_ERROR, "Parsing Schema: group '%s' already defined", ZSTR_VAL(key.s)); + php_error_docref(NULL, E_ERROR, "Parsing Schema: group '%s' already defined", ZSTR_VAL(key.s)); } cur_type = newType; @@ -1190,7 +1190,7 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp zend_hash_next_index_insert_ptr(model->u.content, newModel); } } else { - soap_error(E_ERROR, "Parsing Schema: group has no 'name' nor 'ref' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: group has no 'name' nor 'ref' attributes"); } schema_min_max(groupType, newModel); @@ -1203,31 +1203,31 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp if (trav != NULL) { if (node_is_equal_xsd(trav,"choice")) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); } newModel->kind = XSD_CONTENT_CHOICE; schema_choice(sdl, tns, trav, cur_type, newModel); trav = trav->next; } else if (node_is_equal_xsd(trav,"sequence")) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); } newModel->kind = XSD_CONTENT_SEQUENCE; schema_sequence(sdl, tns, trav, cur_type, newModel); trav = trav->next; } else if (node_is_equal_xsd(trav,"all")) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent"); } newModel->kind = XSD_CONTENT_ALL; schema_all(sdl, tns, trav, cur_type, newModel); trav = trav->next; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); } } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name); } return TRUE; } @@ -1274,7 +1274,7 @@ static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlT } else if (node_is_equal_xsd(trav,"any")) { schema_any(sdl, tns, trav, cur_type, newModel); } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in choice", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in choice", trav->name); } trav = trav->next; } @@ -1324,7 +1324,7 @@ static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTy } else if (node_is_equal_xsd(trav,"any")) { schema_any(sdl, tns, trav, cur_type, newModel); } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in sequence", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in sequence", trav->name); } trav = trav->next; } @@ -1384,13 +1384,13 @@ static int schema_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compCont schema_extension_complexContent(sdl, tns, trav, cur_type); trav = trav->next; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); } } else { - soap_error(E_ERROR, "Parsing Schema: or expected in complexContent"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: or expected in complexContent"); } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name); } return TRUE; @@ -1469,7 +1469,7 @@ static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, s cur_type = ptr; create_encoder(sdl, cur_type, ns->children->content, name->children->content); } else { - soap_error(E_ERROR, "Parsing Schema: complexType has no 'name' attribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: complexType has no 'name' attribute"); return FALSE; } @@ -1509,14 +1509,14 @@ static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, s trav = trav->next; break; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); } trav = trav->next; } } } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name); } return TRUE; } @@ -1619,7 +1619,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp smart_str_0(&key); if (zend_hash_add_ptr(addHash, key.s, newType) == NULL) { if (cur_type == NULL) { - soap_error(E_ERROR, "Parsing Schema: element '%s' already defined", ZSTR_VAL(key.s)); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element '%s' already defined", ZSTR_VAL(key.s)); } else { zend_hash_next_index_insert_ptr(addHash, newType); } @@ -1639,7 +1639,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp } cur_type = newType; } else { - soap_error(E_ERROR, "Parsing Schema: element has no 'name' nor 'ref' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has no 'name' nor 'ref' attributes"); } /* nillable = boolean : false */ @@ -1647,7 +1647,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp attr = get_attribute(attrs, "nillable"); if (attr) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'ref' and 'nillable' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'ref' and 'nillable' attributes"); } if (!stricmp((char*)attr->children->content, "true") || !stricmp((char*)attr->children->content, "1")) { @@ -1662,7 +1662,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp attr = get_attribute(attrs, "fixed"); if (attr) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes"); } cur_type->fixed = estrdup((char*)attr->children->content); } @@ -1670,7 +1670,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp attr = get_attribute(attrs, "default"); if (attr) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes"); } cur_type->def = estrdup((char*)attr->children->content); } @@ -1716,7 +1716,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp xmlNsPtr nsptr; if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'ref' and 'type' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'ref' and 'type' attributes"); } parse_namespace(type->children->content, &cptype, &str_ns); nsptr = xmlSearchNs(element->doc, element, BAD_CAST(str_ns)); @@ -1734,17 +1734,17 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp if (trav != NULL) { if (node_is_equal_xsd(trav,"simpleType")) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); } else if (type != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); } schema_simpleType(sdl, tns, trav, cur_type); trav = trav->next; } else if (node_is_equal_xsd(trav,"complexType")) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype"); } else if (type != NULL) { - soap_error(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype"); } schema_complexType(sdl, tns, trav, cur_type); trav = trav->next; @@ -1758,7 +1758,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp } else if (node_is_equal_xsd(trav,"keyref")) { /* TODO: support */ } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in element", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in element", trav->name); } trav = trav->next; } @@ -1848,11 +1848,11 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl } if (zend_hash_add_ptr(addHash, key.s, newAttr) == NULL) { - soap_error(E_ERROR, "Parsing Schema: attribute '%s' already defined", ZSTR_VAL(key.s)); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attribute '%s' already defined", ZSTR_VAL(key.s)); } smart_str_free(&key); } else{ - soap_error(E_ERROR, "Parsing Schema: attribute has no 'name' nor 'ref' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attribute has no 'name' nor 'ref' attributes"); return FALSE; /* the above call is noreturn, but not marked as such */ } @@ -1864,7 +1864,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl xmlNsPtr nsptr; if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: attribute has both 'ref' and 'type' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attribute has both 'ref' and 'type' attributes"); } parse_namespace(type->children->content, &cptype, &str_ns); nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(str_ns)); @@ -1973,9 +1973,9 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl zval zv; if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: attribute has both 'ref' attribute and subtype"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attribute has both 'ref' attribute and subtype"); } else if (type != NULL) { - soap_error(E_ERROR, "Parsing Schema: attribute has both 'type' attribute and subtype"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attribute has both 'type' attribute and subtype"); } dummy_type = emalloc(sizeof(sdlType)); memset(dummy_type, 0, sizeof(sdlType)); @@ -1997,7 +1997,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl } } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in attribute", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in attribute", trav->name); } return TRUE; } @@ -2033,7 +2033,7 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou smart_str_0(&key); if (zend_hash_add_ptr(ctx->attributeGroups, key.s, newType) == NULL) { - soap_error(E_ERROR, "Parsing Schema: attributeGroup '%s' already defined", ZSTR_VAL(key.s)); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attributeGroup '%s' already defined", ZSTR_VAL(key.s)); } cur_type = newType; smart_str_free(&key); @@ -2067,7 +2067,7 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou cur_type = NULL; } } else{ - soap_error(E_ERROR, "Parsing Schema: attributeGroup has no 'name' nor 'ref' attributes"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attributeGroup has no 'name' nor 'ref' attributes"); } trav = attrGroup->children; @@ -2078,28 +2078,28 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou while (trav != NULL) { if (node_is_equal_xsd(trav,"attribute")) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); } schema_attribute(sdl, tns, trav, cur_type, NULL); } else if (node_is_equal_xsd(trav,"attributeGroup")) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); } schema_attributeGroup(sdl, tns, trav, cur_type, NULL); } else if (node_is_equal_xsd(trav,"anyAttribute")) { if (ref != NULL) { - soap_error(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); + php_error_docref(NULL, E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute"); } /* TODO: support */ trav = trav->next; break; } else { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); } trav = trav->next; } if (trav != NULL) { - soap_error(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name); } return TRUE; } @@ -2247,7 +2247,7 @@ static void schema_content_model_fixup(sdlCtx *ctx, sdlContentModelPtr model) model->kind = XSD_CONTENT_GROUP; model->u.group = tmp; } else { - soap_error(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute '%s'", model->u.group_ref); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unresolved group 'ref' attribute '%s'", model->u.group_ref); } break; } @@ -2304,7 +2304,7 @@ static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type) } else if (strcmp(type->ref, XSD_NAMESPACE ":schema") == 0) { type->encode = get_conversion(XSD_ANYXML); } else { - soap_error(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute '%s'", type->ref); + php_error_docref(NULL, E_ERROR, "Parsing Schema: unresolved element 'ref' attribute '%s'", type->ref); } } efree(type->ref); diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index ff66ffee01c9..7ec36ec1a70c 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -191,7 +191,7 @@ static int is_wsdl_element(xmlNodePtr node) attr->children && attr->children->content && (strcmp((char*)attr->children->content, "1") == 0 || strcmp((char*)attr->children->content, "true") == 0)) { - soap_error(E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href); } return 0; } @@ -310,9 +310,9 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, bool include const xmlError *xmlErrorPtr = xmlGetLastError(); if (xmlErrorPtr) { - soap_error(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message); } else { - soap_error(E_ERROR, "Parsing WSDL: Couldn't load from '%s'", struri); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Couldn't load from '%s'", struri); } } @@ -328,7 +328,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, bool include return; } } - soap_error(E_ERROR, "Parsing WSDL: Couldn't find in '%s'", struri); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Couldn't find in '%s'", struri); } if (!include) { @@ -352,7 +352,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, bool include if (node_is_equal_ex(trav2, "schema", XSD_NAMESPACE)) { load_schema(ctx, trav2); } else if (is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); } trav2 = trav2->next; } @@ -369,43 +369,43 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, bool include xmlAttrPtr name = get_attribute(trav->properties, "name"); if (name && name->children && name->children->content) { if (zend_hash_str_add_ptr(&ctx->messages, (char*)name->children->content, xmlStrlen(name->children->content), trav) == NULL) { - soap_error(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); } } else { - soap_error(E_ERROR, "Parsing WSDL: has no name attribute"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: has no name attribute"); } } else if (node_is_equal(trav,"portType")) { xmlAttrPtr name = get_attribute(trav->properties, "name"); if (name && name->children && name->children->content) { if (zend_hash_str_add_ptr(&ctx->portTypes, (char*)name->children->content, xmlStrlen(name->children->content), trav) == NULL) { - soap_error(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); } } else { - soap_error(E_ERROR, "Parsing WSDL: has no name attribute"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: has no name attribute"); } } else if (node_is_equal(trav,"binding")) { xmlAttrPtr name = get_attribute(trav->properties, "name"); if (name && name->children && name->children->content) { if (zend_hash_str_add_ptr(&ctx->bindings, (char*)name->children->content, xmlStrlen(name->children->content), trav) == NULL) { - soap_error(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); } } else { - soap_error(E_ERROR, "Parsing WSDL: has no name attribute"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: has no name attribute"); } } else if (node_is_equal(trav,"service")) { xmlAttrPtr name = get_attribute(trav->properties, "name"); if (name && name->children && name->children->content) { if (zend_hash_str_add_ptr(&ctx->services, (char*)name->children->content, xmlStrlen(name->children->content), trav) == NULL) { - soap_error(E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: '%s' already defined", name->children->content); } } else { - soap_error(E_ERROR, "Parsing WSDL: has no name attribute"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: has no name attribute"); } } else if (!node_is_equal(trav,"documentation")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } trav = trav->next; } @@ -420,7 +420,7 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml tmp = get_attribute(header->properties, "message"); if (!tmp) { - soap_error(E_ERROR, "Parsing WSDL: Missing message attribute for
"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing message attribute for
"); } ctype = strrchr((char*)tmp->children->content,':'); @@ -430,16 +430,16 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml ++ctype; } if ((message = zend_hash_str_find_ptr(&ctx->messages, ctype, strlen(ctype))) == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing with name '%s'", tmp->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing with name '%s'", tmp->children->content); } tmp = get_attribute(header->properties, "part"); if (!tmp) { - soap_error(E_ERROR, "Parsing WSDL: Missing part attribute for
"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing part attribute for
"); } part = get_node_with_attribute_ex(message->children, "part", WSDL_NAMESPACE, "name", (char*)tmp->children->content, NULL); if (!part) { - soap_error(E_ERROR, "Parsing WSDL: Missing part '%s' in ", tmp->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing part '%s' in ", tmp->children->content); } h = emalloc(sizeof(sdlSoapBindingFunctionHeader)); @@ -466,10 +466,10 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml } else if (strncmp((char*)tmp->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { h->encodingStyle = SOAP_ENCODING_1_2; } else { - soap_error(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content); } } else { - soap_error(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); } } @@ -515,7 +515,7 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml } smart_str_free(&key); } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } trav = trav->next; } @@ -572,7 +572,7 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap } } ZEND_HASH_FOREACH_END(); if (!found) { - soap_error(E_ERROR, "Parsing WSDL: Missing part '%s' in ", parts); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing part '%s' in ", parts); } parts += strlen(parts); if (end) *end = ' '; @@ -589,10 +589,10 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap } else if (strncmp((char*)encodingStyleAttribute->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { binding->encodingStyle = SOAP_ENCODING_1_2; } else { - soap_error(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", encodingStyleAttribute->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", encodingStyleAttribute->children->content); } } else { - soap_error(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); } } } else if (node_is_equal_ex(trav, "header", wsdl_soap_namespace)) { @@ -615,7 +615,7 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap } smart_str_free(&key); } else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } trav = trav->next; } @@ -634,7 +634,7 @@ static HashTable* wsdl_message(const sdlCtx *ctx, const xmlChar* message_name) xmlNodePtr message = zend_hash_str_find_ptr(&ctx->messages, ctype, strlen(ctype)); if (message == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing with name '%s'", (const char*)message_name); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing with name '%s'", (const char*)message_name); } parameters = emalloc(sizeof(HashTable)); @@ -646,14 +646,14 @@ static HashTable* wsdl_message(const sdlCtx *ctx, const xmlChar* message_name) sdlParamPtr param; if (trav->ns != NULL && strcmp((char*)trav->ns->href, WSDL_NAMESPACE) != 0) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", SAFE_STR(trav->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", SAFE_STR(trav->name)); } if (node_is_equal(trav,"documentation")) { trav = trav->next; continue; } if (!node_is_equal(trav,"part")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } xmlNodePtr part = trav; param = emalloc(sizeof(sdlParam)); @@ -662,7 +662,7 @@ static HashTable* wsdl_message(const sdlCtx *ctx, const xmlChar* message_name) name = get_attribute(part->properties, "name"); if (name == NULL) { - soap_error(E_ERROR, "Parsing WSDL: No name associated with '%s'", SAFE_STR(message->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: No name associated with '%s'", SAFE_STR(message->name)); } param->paramName = estrdup((char*)name->children->content); @@ -708,7 +708,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) uint32_t n = zend_hash_num_elements(&ctx.services); if (n == 0) { - soap_error(E_ERROR, "Parsing WSDL: Couldn't bind to service"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Couldn't bind to service"); } zend_hash_internal_pointer_reset(&ctx.services); @@ -733,7 +733,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) continue; } if (!node_is_equal(trav,"port")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav->name)); } port = trav; @@ -743,7 +743,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) bindingAttr = get_attribute(port->properties, "binding"); if (bindingAttr == NULL) { - soap_error(E_ERROR, "Parsing WSDL: No binding associated with "); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: No binding associated with "); } /* find address and figure out binding type */ @@ -772,7 +772,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) } } if (trav2 != address && is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); } trav2 = trav2->next; } @@ -782,14 +782,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) trav = trav->next; continue; } else if (!address) { - soap_error(E_ERROR, "Parsing WSDL: No address associated with "); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: No address associated with "); } } has_soap_port = true; location = get_attribute(address->properties, "location"); if (!location) { - soap_error(E_ERROR, "Parsing WSDL: No location associated with "); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: No location associated with "); } tmpbinding->location = estrdup((char*)location->children->content); @@ -801,7 +801,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) ++ctype; } if ((tmp = zend_hash_str_find_ptr(&ctx.bindings, ctype, strlen(ctype))) == NULL) { - soap_error(E_ERROR, "Parsing WSDL: No element with name '%s'", ctype); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: No element with name '%s'", ctype); } binding = tmp; @@ -839,13 +839,13 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) name = get_attribute(binding->properties, "name"); if (name == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); } tmpbinding->name = estrdup((char*)name->children->content); type = get_attribute(binding->properties, "type"); if (type == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing 'type' attribute for "); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing 'type' attribute for "); } ctype = strchr((char*)type->children->content,':'); @@ -855,7 +855,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) ++ctype; } if ((tmp = zend_hash_str_find_ptr(&ctx.portTypes, ctype, strlen(ctype))) == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing with name '%s'", name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing with name '%s'", name->children->content); } portType = tmp; @@ -873,14 +873,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) continue; } if (!node_is_equal(trav2,"operation")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav2->name)); } operation = trav2; op_name = get_attribute(operation->properties, "name"); if (op_name == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); } trav3 = operation->children; @@ -892,14 +892,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) !node_is_equal(trav3,"output") && !node_is_equal(trav3,"fault") && !node_is_equal(trav3,"documentation")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav3->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(trav3->name)); } trav3 = trav3->next; } portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", (char*)op_name->children->content, NULL); if (portTypeOperation == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing / with name '%s'", op_name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing / with name '%s'", op_name->children->content); } function = emalloc(sizeof(sdlFunction)); @@ -944,7 +944,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) message = get_attribute(input->properties, "message"); if (message == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); } function->requestParameters = wsdl_message(&ctx, message->children->content); @@ -973,7 +973,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) message = get_attribute(output->properties, "message"); if (message == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); } function->responseParameters = wsdl_message(&ctx, message->children->content); @@ -1014,11 +1014,11 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) xmlAttrPtr faultNameAttribute = get_attribute(fault->properties, "name"); if (faultNameAttribute == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); } message = get_attribute(fault->properties, "message"); if (message == NULL) { - soap_error(E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Missing name for of '%s'", op_name->children->content); } f = emalloc(sizeof(sdlFault)); @@ -1027,7 +1027,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) f->name = estrdup((char*)faultNameAttribute->children->content); f->details = wsdl_message(&ctx, message->children->content); if (f->details == NULL || zend_hash_num_elements(f->details) > 1) { - soap_error(E_ERROR, "Parsing WSDL: The fault message '%s' must have a single part", message->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: The fault message '%s' must have a single part", message->children->content); } if (tmpbinding->bindingType == BINDING_SOAP) { @@ -1061,14 +1061,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) } else if (strncmp((char*)faultEncodingStyleAttribute->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) { faultBinding->encodingStyle = SOAP_ENCODING_1_2; } else { - soap_error(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", faultEncodingStyleAttribute->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", faultEncodingStyleAttribute->children->content); } } else { - soap_error(E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unspecified encodingStyle"); } } } else if (is_wsdl_element(faultNodes) && !node_is_equal(faultNodes,"documentation")) { - soap_error(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(faultNodes->name)); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", SAFE_STR(faultNodes->name)); } faultNodes = faultNodes->next; } @@ -1079,7 +1079,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) zend_hash_init(function->faults, 0, NULL, delete_fault, 0); } if (zend_hash_str_add_ptr(function->faults, f->name, strlen(f->name), f) == NULL) { - soap_error(E_ERROR, "Parsing WSDL: with name '%s' already defined in '%s'", f->name, op_name->children->content); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: with name '%s' already defined in '%s'", f->name, op_name->children->content); } } fault = fault->next; @@ -1126,7 +1126,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) } if (ctx.sdl->bindings == NULL || ctx.sdl->bindings->nNumOfElements == 0) { - soap_error(E_ERROR, "Parsing WSDL: Could not find any usable binding services in WSDL."); + php_error_docref(NULL, E_ERROR, "Parsing WSDL: Could not find any usable binding services in WSDL."); } } zend_catch { diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index 12def762e907..680e0f0cd60c 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -197,9 +197,6 @@ extern HashTable php_soap_defEncNs, php_soap_defEnc, php_soap_defEncIndex; void add_soap_fault(zval *obj, const char *fault_code, const char *fault_string, zend_string *fault_actor, zval *fault_detail, zend_string *lang); -#define soap_error(severity, format, ...) \ - php_error_docref(NULL, severity, "SOAP-ERROR: " format, ## __VA_ARGS__) - static zend_always_inline zval *php_soap_deref(zval *zv) { if (UNEXPECTED(Z_TYPE_P(zv) == IS_REFERENCE)) { return Z_REFVAL_P(zv); diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 339263243cb4..bf25ce0e94dc 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4080,7 +4080,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX)); xmlSetNs(envelope, ns); } else { - soap_error(E_ERROR, "Unknown SOAP version"); + php_error_docref(NULL, E_ERROR, "Unknown SOAP version"); } xmlDocSetRootElement(doc, envelope); diff --git a/ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt b/ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt index e9c40af2f90f..a21680fadc2d 100644 --- a/ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt +++ b/ext/soap/tests/GHSA-hmxp-6pc4-f3vv.phpt @@ -36,4 +36,4 @@ $server->handle($request); ?> --EXPECT-- -SOAP-ENV:ServerSoapServer::handle(): SOAP-ERROR: Encoding: Can't decode apache map, missing value +SOAP-ENV:ServerSoapServer::handle(): Encoding: Can't decode apache map, missing value diff --git a/ext/soap/tests/bugs/bug34657.phpt b/ext/soap/tests/bugs/bug34657.phpt index a4fd99cd7c6f..dc37c33627bc 100644 --- a/ext/soap/tests/bugs/bug34657.phpt +++ b/ext/soap/tests/bugs/bug34657.phpt @@ -17,6 +17,6 @@ try { ?> --EXPECTF-- SoapFault -SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://i_dont_exist.com/some.wsdl'%A +SoapClient::__construct(): Parsing WSDL: Couldn't load from 'http://i_dont_exist.com/some.wsdl'%A ok diff --git a/ext/soap/tests/bugs/bug39832.phpt b/ext/soap/tests/bugs/bug39832.phpt index 5dcbbacb5d4a..85d319d10742 100644 --- a/ext/soap/tests/bugs/bug39832.phpt +++ b/ext/soap/tests/bugs/bug39832.phpt @@ -26,4 +26,4 @@ $x->handle($HTTP_RAW_POST_DATA); ?> --EXPECT-- -SOAP-ENV:ServerSoapServer::handle(): SOAP-ERROR: Encoding: Invalid value for type 'integer' +SOAP-ENV:ServerSoapServer::handle(): Encoding: Invalid value for type 'integer' diff --git a/ext/soap/tests/bugs/bug42151.phpt b/ext/soap/tests/bugs/bug42151.phpt index 21d451a2f157..d5a7032bd9c3 100644 --- a/ext/soap/tests/bugs/bug42151.phpt +++ b/ext/soap/tests/bugs/bug42151.phpt @@ -26,7 +26,7 @@ try { echo "ok\n"; ?> --EXPECTF-- -SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s +SoapClient::__construct(): Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s ok I don't get executed either. diff --git a/ext/soap/tests/bugs/bug42488.phpt b/ext/soap/tests/bugs/bug42488.phpt index 555d367c868c..bb9dc3a0acc2 100644 --- a/ext/soap/tests/bugs/bug42488.phpt +++ b/ext/soap/tests/bugs/bug42488.phpt @@ -19,4 +19,4 @@ $soap->handle($request); ?> --EXPECT-- -SOAP-ENV:ServerSoapServer::handle(): SOAP-ERROR: Encoding: string 'stuff\x93...' is not a valid utf-8 string +SOAP-ENV:ServerSoapServer::handle(): Encoding: string 'stuff\x93...' is not a valid utf-8 string diff --git a/ext/soap/tests/bugs/bug44686.phpt b/ext/soap/tests/bugs/bug44686.phpt index 70261ab5b368..51430fc682f4 100644 --- a/ext/soap/tests/bugs/bug44686.phpt +++ b/ext/soap/tests/bugs/bug44686.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #44686 (SOAP-ERROR: Parsing WSDL with references) +Bug #44686 (Parsing WSDL with references) --EXTENSIONS-- soap --INI-- diff --git a/ext/soap/tests/bugs/bug44811.phpt b/ext/soap/tests/bugs/bug44811.phpt index 4fee5e9ec4c9..aa6579f67403 100644 --- a/ext/soap/tests/bugs/bug44811.phpt +++ b/ext/soap/tests/bugs/bug44811.phpt @@ -16,6 +16,6 @@ try { die('ok'); ?> --EXPECTF-- -SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://php.net' : %s +Parsing WSDL: Couldn't load from 'https://php.net' : %s ok diff --git a/ext/soap/tests/bugs/bug50698_2.phpt b/ext/soap/tests/bugs/bug50698_2.phpt index 989fa98b5c05..21648fff09ea 100644 --- a/ext/soap/tests/bugs/bug50698_2.phpt +++ b/ext/soap/tests/bugs/bug50698_2.phpt @@ -10,7 +10,7 @@ try { new SoapClient(__DIR__ . '/bug50698_2.wsdl'); echo "Call: \"new SoapClient(__DIR__.'/bug50698_2.wsdl');\" should throw an exception of type 'SoapFault'"; } catch (SoapFault $e) { - if ($e->faultcode == 'WSDL' && $e->faultstring == 'SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL.') { + if ($e->faultcode == 'WSDL' && $e->faultstring == 'Parsing WSDL: Could not find any usable binding services in WSDL.') { echo "ok\n"; } else { echo "Call: \"new SoapClient(__DIR__.'/bug50698_2.wsdl');\" threw a SoapFault with an incorrect faultcode or faultmessage."; @@ -18,26 +18,26 @@ try { } } ?> ---EXPECT-- +--EXPECTF-- Call: "new SoapClient(__DIR__.'/bug50698_2.wsdl');" threw a SoapFault with an incorrect faultcode or faultmessage.SoapFault Object ( - [message:protected] => SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. + [message:protected] => SoapClient::__construct(): Parsing WSDL: Could not find any usable binding services in WSDL. [string:Exception:private] => [code:protected] => 0 - [file:protected] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_2.php + [file:protected] => %s/ext/soap/tests/bugs/bug50698_2.php [line:protected] => 3 [trace:Exception:private] => Array ( [0] => Array ( - [file] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_2.php + [file] => %s/ext/soap/tests/bugs/bug50698_2.php [line] => 3 [function] => __construct [class] => SoapClient [type] => -> [args] => Array ( - [0] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_2.wsdl + [0] => %s/ext/soap/tests/bugs/bug50698_2.wsdl ) ) @@ -45,7 +45,7 @@ Call: "new SoapClient(__DIR__.'/bug50698_2.wsdl');" threw a SoapFault with an in ) [previous:Exception:private] => - [faultstring] => SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. + [faultstring] => SoapClient::__construct(): Parsing WSDL: Could not find any usable binding services in WSDL. [faultcode] => WSDL [faultcodens] => [faultactor] => diff --git a/ext/soap/tests/bugs/bug50698_3.phpt b/ext/soap/tests/bugs/bug50698_3.phpt index 9e82849b80b8..6bc2e43cbdd2 100644 --- a/ext/soap/tests/bugs/bug50698_3.phpt +++ b/ext/soap/tests/bugs/bug50698_3.phpt @@ -10,7 +10,7 @@ try { new SoapClient(__DIR__ . '/bug50698_3.wsdl'); echo "Call: \"new SoapClient(__DIR__.'/bug50698_3.wsdl');\" should throw an exception of type 'SoapFault'"; } catch (SoapFault $e) { - if ($e->faultcode == 'WSDL' && $e->faultstring == 'SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL.') { + if ($e->faultcode == 'WSDL' && $e->faultstring == 'Parsing WSDL: Could not find any usable binding services in WSDL.') { echo "ok\n"; } else { echo "Call: \"new SoapClient(__DIR__.'/bug50698_3.wsdl');\" threw a SoapFault with an incorrect faultcode or faultmessage."; @@ -18,26 +18,26 @@ try { } } ?> ---EXPECT-- +--EXPECTF-- Call: "new SoapClient(__DIR__.'/bug50698_3.wsdl');" threw a SoapFault with an incorrect faultcode or faultmessage.SoapFault Object ( - [message:protected] => SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. + [message:protected] => SoapClient::__construct(): Parsing WSDL: Could not find any usable binding services in WSDL. [string:Exception:private] => [code:protected] => 0 - [file:protected] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_3.php + [file:protected] => %s/ext/soap/tests/bugs/bug50698_3.php [line:protected] => 3 [trace:Exception:private] => Array ( [0] => Array ( - [file] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_3.php + [file] => %s/ext/soap/tests/bugs/bug50698_3.php [line] => 3 [function] => __construct [class] => SoapClient [type] => -> [args] => Array ( - [0] => /Users/calvin/src/php-src/ext/soap/tests/bugs/bug50698_3.wsdl + [0] => %s/ext/soap/tests/bugs/bug50698_3.wsdl ) ) @@ -45,7 +45,7 @@ Call: "new SoapClient(__DIR__.'/bug50698_3.wsdl');" threw a SoapFault with an in ) [previous:Exception:private] => - [faultstring] => SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL. + [faultstring] => SoapClient::__construct(): Parsing WSDL: Could not find any usable binding services in WSDL. [faultcode] => WSDL [faultcodens] => [faultactor] => diff --git a/ext/soap/tests/bugs/bug62900.phpt b/ext/soap/tests/bugs/bug62900.phpt index 80d048b1dbea..e73aafd42978 100644 --- a/ext/soap/tests/bugs/bug62900.phpt +++ b/ext/soap/tests/bugs/bug62900.phpt @@ -70,25 +70,25 @@ foreach ($combinations as list($wsdl, $xsd)) { @unlink(__DIR__."/bug62900.xsd"); ?> --EXPECTF-- -Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing Schema: can't import schema from '/Users/calvin/src/php-src/ext/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d +Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): Parsing Schema: can't import schema from '%s/ext/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d Stack trace: #0 %s(%d): SoapClient->__construct(%s) #1 {main} thrown in %s on line %d -Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing Schema: can't import schema from '/Users/calvin/src/php-src/ext/soap/tests/bugs/bug62900.xsd', missing 'targetNamespace', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d +Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): Parsing Schema: can't import schema from '%s/ext/soap/tests/bugs/bug62900.xsd', missing 'targetNamespace', expected 'http://www.w3.org/XML/1998/namespace' in %s:%d Stack trace: #0 %s(%d): SoapClient->__construct(%s) #1 {main} thrown in %s on line %d -Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing Schema: can't import schema from '/Users/calvin/src/php-src/ext/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected no 'targetNamespace' in %s:%d +Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): Parsing Schema: can't import schema from '%s/ext/soap/tests/bugs/bug62900.xsd', unexpected 'targetNamespace'='http://www.w3.org/XML/1998/namespacex', expected no 'targetNamespace' in %s:%d Stack trace: #0 %s(%d): SoapClient->__construct(%s) #1 {main} thrown in %s on line %d -Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Couldn't bind to service in %s:%d +Fatal error: Uncaught SoapFault exception: [WSDL] SoapClient::__construct(): Parsing WSDL: Couldn't bind to service in %s:%d Stack trace: #0 %s(%d): SoapClient->__construct(%s) #1 {main} diff --git a/ext/soap/tests/bugs/bug68576.phpt b/ext/soap/tests/bugs/bug68576.phpt index cbc5e754ce59..1d1052af0014 100644 --- a/ext/soap/tests/bugs/bug68576.phpt +++ b/ext/soap/tests/bugs/bug68576.phpt @@ -14,4 +14,4 @@ try { ?> --EXPECT-- SoapFault -SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Couldn't bind to service +SoapClient::__construct(): Parsing WSDL: Couldn't bind to service diff --git a/ext/soap/tests/bugs/bug73037.phpt b/ext/soap/tests/bugs/bug73037.phpt index 7a5b99776772..a1959743243c 100644 --- a/ext/soap/tests/bugs/bug73037.phpt +++ b/ext/soap/tests/bugs/bug73037.phpt @@ -136,43 +136,43 @@ cleanup: --EXPECT-- Iteration 0 -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist Iteration 1 -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist Iteration 2 -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist Iteration 3 -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist Iteration 4 -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist Iteration 5 -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist Iteration 6 -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist -Function 'CATALOG' doesn't exist +SoapServer::handle(): Function 'CATALOG' doesn't exist diff --git a/ext/soap/tests/bugs/bug79357.phpt b/ext/soap/tests/bugs/bug79357.phpt index d1f397874f7a..7c1852e6ff6a 100644 --- a/ext/soap/tests/bugs/bug79357.phpt +++ b/ext/soap/tests/bugs/bug79357.phpt @@ -11,7 +11,7 @@ var_dump($res); ?> --EXPECTF-- -Fatal error: Uncaught SoapFault exception: [Client] SoapClient::__call(): SOAP-ERROR: Encoding: object has no 'intB' property in %s:%d +Fatal error: Uncaught SoapFault exception: [Client] SoapClient::__call(): Encoding: object has no 'intB' property in %s:%d Stack trace: #0 %s(%d): SoapClient->__call('Add', Array) #1 {main} diff --git a/ext/soap/tests/bugs/bug80672.phpt b/ext/soap/tests/bugs/bug80672.phpt index c668d12072ed..40d8c5e16f21 100644 --- a/ext/soap/tests/bugs/bug80672.phpt +++ b/ext/soap/tests/bugs/bug80672.phpt @@ -12,4 +12,4 @@ try { } ?> --EXPECT-- -SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <> +SoapClient::__construct(): Parsing WSDL: Unexpected WSDL element <> diff --git a/ext/soap/tests/bugs/gh22167.phpt b/ext/soap/tests/bugs/gh22167.phpt index 8b21935781e8..0ec5a0270e4a 100644 --- a/ext/soap/tests/bugs/gh22167.phpt +++ b/ext/soap/tests/bugs/gh22167.phpt @@ -105,24 +105,24 @@ foreach ($cases as $name => $schema) { } ?> --EXPECT-- -minOccurs: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minOccurs value is out of range -maxOccurs: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -negative minOccurs: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minOccurs value is out of range -negative maxOccurs: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -minExclusive: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minExclusive value is out of range -minInclusive: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minInclusive value is out of range -maxExclusive: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxExclusive value is out of range -maxInclusive: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxInclusive value is out of range -totalDigits: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: totalDigits value is out of range -fractionDigits: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: fractionDigits value is out of range -length: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: length value is out of range -minLength: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: minLength value is out of range -maxLength: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxLength value is out of range -leading whitespace numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading plus numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading zero numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading numeric-string with trailing data: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -negative out-of-range numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -decimal numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -exponent numeric-string: SoapClient::__construct(): SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +minOccurs: SoapClient::__construct(): Parsing Schema: minOccurs value is out of range +maxOccurs: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range +negative minOccurs: SoapClient::__construct(): Parsing Schema: minOccurs value is out of range +negative maxOccurs: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range +minExclusive: SoapClient::__construct(): Parsing Schema: minExclusive value is out of range +minInclusive: SoapClient::__construct(): Parsing Schema: minInclusive value is out of range +maxExclusive: SoapClient::__construct(): Parsing Schema: maxExclusive value is out of range +maxInclusive: SoapClient::__construct(): Parsing Schema: maxInclusive value is out of range +totalDigits: SoapClient::__construct(): Parsing Schema: totalDigits value is out of range +fractionDigits: SoapClient::__construct(): Parsing Schema: fractionDigits value is out of range +length: SoapClient::__construct(): Parsing Schema: length value is out of range +minLength: SoapClient::__construct(): Parsing Schema: minLength value is out of range +maxLength: SoapClient::__construct(): Parsing Schema: maxLength value is out of range +leading whitespace numeric-string: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range +leading plus numeric-string: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range +leading zero numeric-string: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range +leading numeric-string with trailing data: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range +negative out-of-range numeric-string: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range +decimal numeric-string: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range +exponent numeric-string: SoapClient::__construct(): Parsing Schema: maxOccurs value is out of range fractional numeric-string within int range: parsed diff --git a/ext/soap/tests/hexbin_odd_length.phpt b/ext/soap/tests/hexbin_odd_length.phpt index ec098e029346..f5f780ff0891 100644 --- a/ext/soap/tests/hexbin_odd_length.phpt +++ b/ext/soap/tests/hexbin_odd_length.phpt @@ -34,4 +34,4 @@ try { } ?> --EXPECT-- -SoapClient::__call(): SOAP-ERROR: Encoding: Type 'hexBinary' value must contain an even number of hexadecimal digits +SoapClient::__call(): Encoding: Type 'hexBinary' value must contain an even number of hexadecimal digits diff --git a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt index e19a9b34ecba..a3b775e35d02 100644 --- a/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt +++ b/ext/soap/tests/interop/Round3/GroupF/r3_groupF_extreq_001w.phpt @@ -14,4 +14,4 @@ echo $client->__getlastrequest(); echo "ok\n"; ?> --EXPECTF-- -Fatal error: SoapClient::__construct(): SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://soapinterop.org/ext' in %s on line %d +Fatal error: SoapClient::__construct(): Parsing WSDL: Unknown required WSDL extension 'http://soapinterop.org/ext' in %s on line %d diff --git a/ext/soap/tests/scalar_error_messages.phpt b/ext/soap/tests/scalar_error_messages.phpt index 1e0bd2659b25..ceec6658e16b 100644 --- a/ext/soap/tests/scalar_error_messages.phpt +++ b/ext/soap/tests/scalar_error_messages.phpt @@ -47,6 +47,6 @@ run_case('long', 'xsd:long', 'abc'); run_case('base64Binary node', 'xsd:base64Binary', 'abc'); ?> --EXPECT-- -double: SoapClient::__soapCall(): SOAP-ERROR: Encoding: Invalid value for type 'double' -long: SoapClient::__soapCall(): SOAP-ERROR: Encoding: Invalid value for type 'long' -base64Binary node: SoapClient::__soapCall(): SOAP-ERROR: Encoding: Type 'base64Binary' value must contain a single text or CDATA node +double: SoapClient::__soapCall(): Encoding: Invalid value for type 'double' +long: SoapClient::__soapCall(): Encoding: Invalid value for type 'long' +base64Binary node: SoapClient::__soapCall(): Encoding: Type 'base64Binary' value must contain a single text or CDATA node diff --git a/ext/soap/tests/schema/schema068.phpt b/ext/soap/tests/schema/schema068.phpt index d101ae08c0b5..7dac2c3aedad 100644 --- a/ext/soap/tests/schema/schema068.phpt +++ b/ext/soap/tests/schema/schema068.phpt @@ -16,4 +16,4 @@ test_schema($schema,'type="tns:testType"',(object)array("str"=>"str","int"=>4)); echo "ok"; ?> --EXPECTF-- -Fatal error: SoapClient::__call(): SOAP-ERROR: Encoding: Attribute 'int' has fixed value '5' (value '4' is not allowed) in %s on line %d +Fatal error: SoapClient::__call(): Encoding: Attribute 'int' has fixed value '5' (value '4' is not allowed) in %s on line %d diff --git a/ext/soap/tests/soap12/T27.phpt b/ext/soap/tests/soap12/T27.phpt index 0139907df828..2fba0d65365b 100644 --- a/ext/soap/tests/soap12/T27.phpt +++ b/ext/soap/tests/soap12/T27.phpt @@ -25,4 +25,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: Type 'string' value must contain a single text or CDATA node +env:ReceiverSoapServer::handle(): Encoding: Type 'string' value must contain a single text or CDATA node diff --git a/ext/soap/tests/soap12/T56.phpt b/ext/soap/tests/soap12/T56.phpt index 3949c6aa2413..546de2a492b2 100644 --- a/ext/soap/tests/soap12/T56.phpt +++ b/ext/soap/tests/soap12/T56.phpt @@ -30,4 +30,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: Unresolved reference '#data-2' +env:ReceiverSoapServer::handle(): Encoding: Unresolved reference '#data-2' diff --git a/ext/soap/tests/soap12/T58.phpt b/ext/soap/tests/soap12/T58.phpt index b76bc02969d8..17e2b90186d8 100644 --- a/ext/soap/tests/soap12/T58.phpt +++ b/ext/soap/tests/soap12/T58.phpt @@ -24,4 +24,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: Type 'int' value must contain a single text or CDATA node +env:ReceiverSoapServer::handle(): Encoding: Type 'int' value must contain a single text or CDATA node diff --git a/ext/soap/tests/soap12/T59.phpt b/ext/soap/tests/soap12/T59.phpt index fd5741d34209..8d6f38c94516 100644 --- a/ext/soap/tests/soap12/T59.phpt +++ b/ext/soap/tests/soap12/T59.phpt @@ -25,4 +25,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: Violation of id and ref information items '#data' +env:ReceiverSoapServer::handle(): Encoding: Violation of id and ref information items '#data' diff --git a/ext/soap/tests/soap12/T61.phpt b/ext/soap/tests/soap12/T61.phpt index cfc83d341b07..6276b4eebd6a 100644 --- a/ext/soap/tests/soap12/T61.phpt +++ b/ext/soap/tests/soap12/T61.phpt @@ -25,4 +25,4 @@ include "soap12-test.inc"; ?> --EXPECT-- -env:ReceiverSoapServer::handle(): SOAP-ERROR: Encoding: '*' may only be first arraySize value in list +env:ReceiverSoapServer::handle(): Encoding: '*' may only be first arraySize value in list diff --git a/ext/soap/tests/soap_array_index_overflow.phpt b/ext/soap/tests/soap_array_index_overflow.phpt index f381bfc14e44..4164ca651456 100644 --- a/ext/soap/tests/soap_array_index_overflow.phpt +++ b/ext/soap/tests/soap_array_index_overflow.phpt @@ -80,9 +80,9 @@ test_overflow( test_boundary_position(); ?> --EXPECT-- -arrayType: SoapClient::__call(): SOAP-ERROR: Encoding: array index out of range -offset: SoapClient::__call(): SOAP-ERROR: Encoding: array index out of range -position: SoapClient::__call(): SOAP-ERROR: Encoding: array index out of range +arrayType: SoapClient::__call(): Encoding: array index out of range +offset: SoapClient::__call(): Encoding: array index out of range +position: SoapClient::__call(): Encoding: array index out of range array(1) { [2147483646]=> string(5) "value" diff --git a/ext/zend_test/tests/observer_error_04.phpt b/ext/zend_test/tests/observer_error_04.phpt index 2a45bfe78c48..dfd6caf6de9c 100644 --- a/ext/zend_test/tests/observer_error_04.phpt +++ b/ext/zend_test/tests/observer_error_04.phpt @@ -47,9 +47,9 @@ echo 'Done.' . PHP_EOL; - -SOAP-ERROR: Parsing WSDL: %s +SoapClient::__construct(): Parsing WSDL: %s Done. From 0db3ae63f3634c318bc9955d73c2f5cd924a0113 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 15:11:57 -0300 Subject: [PATCH 06/13] standard: remove php/zend_error usage from net_get_interfaces --- ext/standard/net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/standard/net.c b/ext/standard/net.c index 199db6e80943..bd7eb4e0a004 100644 --- a/ext/standard/net.c +++ b/ext/standard/net.c @@ -167,7 +167,7 @@ PHP_FUNCTION(net_get_interfaces) { } if (pAddresses == NULL) { - zend_error(E_WARNING, "Memory allocation failed for IP_ADAPTER_ADDRESSES struct"); + php_error_docref(NULL, E_WARNING, "Memory allocation failed for IP_ADAPTER_ADDRESSES struct"); RETURN_FALSE; } @@ -175,7 +175,7 @@ PHP_FUNCTION(net_get_interfaces) { if (NO_ERROR != dwRetVal) { char *buf = php_win32_error_to_msg(GetLastError()); - zend_error(E_WARNING, "GetAdaptersAddresses failed: %s", buf); + php_error_docref(NULL, E_WARNING, "GetAdaptersAddresses failed: %s", buf); php_win32_error_msg_free(buf); FREE(pAddresses); RETURN_FALSE; @@ -265,7 +265,7 @@ PHP_FUNCTION(net_get_interfaces) { ZEND_PARSE_PARAMETERS_NONE(); if (getifaddrs(&addrs)) { - php_error(E_WARNING, "getifaddrs() failed %d: %s", errno, strerror(errno)); + php_error_docref(NULL, E_WARNING, "getifaddrs() failed %d: %s", errno, strerror(errno)); RETURN_FALSE; } From b714d9160fa3ea67580b45d4aeffdf817a060723 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 15:13:30 -0300 Subject: [PATCH 07/13] standard: remove php/zend_error usage from browscap --- ext/standard/browscap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 7534615a946b..d91cb3b5df6b 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -333,7 +333,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb if (ctx->current_section_name != NULL && zend_string_equals_ci(ctx->current_section_name, Z_STR_P(arg2)) ) { - zend_error(E_CORE_ERROR, "Invalid browscap ini file: " + php_error_docref(NULL, E_CORE_ERROR, "Invalid browscap ini file: " "'Parent' value cannot be same as the section name: %s " "(in file %s)", ZSTR_VAL(ctx->current_section_name), zend_ini_string_literal("browscap")); return; @@ -409,7 +409,7 @@ static zend_result browscap_read_file(const char *filename, browser_data *browda fp = VCWD_FOPEN(filename, "r"); if (!fp) { - zend_error(E_CORE_WARNING, "Cannot open \"%s\" for reading", filename); + php_error_docref(NULL, E_CORE_WARNING, "Cannot open \"%s\" for reading", filename); return FAILURE; } zend_stream_init_fp(&fh, fp, filename); From a9052ab7ad73407ea31f06d037e75c4c651f44af Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 15:16:35 -0300 Subject: [PATCH 08/13] standard: remove php/zend_error usage from ini_parse_quantity --- Zend/tests/zend_ini/gh16886.phpt | 18 +++++++++--------- ext/standard/basic_functions.c | 2 +- tests/basic/ini_parse_quantity_warnings.phpt | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Zend/tests/zend_ini/gh16886.phpt b/Zend/tests/zend_ini/gh16886.phpt index 2e8589457235..8eac3e586bb7 100644 --- a/Zend/tests/zend_ini/gh16886.phpt +++ b/Zend/tests/zend_ini/gh16886.phpt @@ -13,29 +13,29 @@ echo ini_parse_quantity('0o+0'), "\n"; echo ini_parse_quantity('0o-0'), "\n"; ?> --EXPECTF-- -Warning: Invalid quantity "0x 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0x 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 -Warning: Invalid quantity "0x+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0x+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 -Warning: Invalid quantity "0x-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0x-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 -Warning: Invalid quantity "0b 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0b 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 -Warning: Invalid quantity "0b+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0b+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 -Warning: Invalid quantity "0b-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0b-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 -Warning: Invalid quantity "0o 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0o 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 -Warning: Invalid quantity "0o+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0o+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 -Warning: Invalid quantity "0o-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d +Warning: ini_parse_quantity(): Invalid quantity "0o-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d 0 diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index e81050323754..0d89acbfdf45 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1884,7 +1884,7 @@ PHP_FUNCTION(ini_parse_quantity) RETVAL_LONG(zend_ini_parse_quantity(shorthand, &errstr)); if (errstr) { - zend_error(E_WARNING, "%s", ZSTR_VAL(errstr)); + php_error_docref(NULL, E_WARNING, "%s", ZSTR_VAL(errstr)); zend_string_release(errstr); } } diff --git a/tests/basic/ini_parse_quantity_warnings.phpt b/tests/basic/ini_parse_quantity_warnings.phpt index a56155833944..c11c3d8a8cdb 100644 --- a/tests/basic/ini_parse_quantity_warnings.phpt +++ b/tests/basic/ini_parse_quantity_warnings.phpt @@ -9,6 +9,6 @@ ini_parse_quantity('1mb'); ini_parse_quantity('256 then skip a few then g') ?> --EXPECTF-- -Warning: Invalid quantity "1mb": unknown multiplier "b", interpreting as "1" for backwards compatibility in %sini_parse_quantity_warnings.php on line 3 +Warning: ini_parse_quantity(): Invalid quantity "1mb": unknown multiplier "b", interpreting as "1" for backwards compatibility in %s on line %d -Warning: Invalid quantity "256 then skip a few then g", interpreting as "256 g" for backwards compatibility in %sini_parse_quantity_warnings.php on line 4 +Warning: ini_parse_quantity(): Invalid quantity "256 then skip a few then g", interpreting as "256 g" for backwards compatibility in %s on line %d From 940ee8522dd4ba253f2fc091a290fbb29187a140 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 15:24:32 -0300 Subject: [PATCH 09/13] standard: remove zend_error from auto_detect_line_endings --- ext/standard/file.c | 2 +- ext/standard/tests/file/auto_detect_line_endings_1.phpt | 2 +- ext/standard/tests/file/auto_detect_line_endings_2.phpt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index fd6f578e4ef0..e4e775e07367 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -137,7 +137,7 @@ static void file_globals_dtor(php_file_globals *file_globals_p) static PHP_INI_MH(OnUpdateAutoDetectLineEndings) { if (zend_ini_parse_bool(new_value)) { - zend_error(E_DEPRECATED, "auto_detect_line_endings is deprecated"); + php_error_docref(NULL, E_DEPRECATED, "auto_detect_line_endings is deprecated"); } return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage); } diff --git a/ext/standard/tests/file/auto_detect_line_endings_1.phpt b/ext/standard/tests/file/auto_detect_line_endings_1.phpt index 4bdbabb03b5c..ff8029b1b866 100644 --- a/ext/standard/tests/file/auto_detect_line_endings_1.phpt +++ b/ext/standard/tests/file/auto_detect_line_endings_1.phpt @@ -16,7 +16,7 @@ var_dump(fgets(STDIN)); echo "Done\n"; ?> --EXPECT-- -Deprecated: auto_detect_line_endings is deprecated in Unknown on line 0 +Deprecated: PHP Startup: auto_detect_line_endings is deprecated in Unknown on line 0 string(1) "1" string(8) "fooBar1 " string(8) "fooBar2 " diff --git a/ext/standard/tests/file/auto_detect_line_endings_2.phpt b/ext/standard/tests/file/auto_detect_line_endings_2.phpt index 79d51535cb09..6beb597162b5 100644 --- a/ext/standard/tests/file/auto_detect_line_endings_2.phpt +++ b/ext/standard/tests/file/auto_detect_line_endings_2.phpt @@ -17,7 +17,7 @@ var_dump(fgets($stdin)); echo "Done\n"; ?> --EXPECTF-- -Deprecated: auto_detect_line_endings is deprecated in %s on line %d +Deprecated: ini_set(): auto_detect_line_endings is deprecated in %s on line %d string(2) "on" string(8) "fooBar1 " string(8) "fooBar2 " From ad8ad2d5f4a88c660c1d25c82e94768e6667b721 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 18:14:00 -0300 Subject: [PATCH 10/13] pdo: remove zend_error usage --- ext/pdo/pdo_dbh.c | 2 +- ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt | 4 ++-- ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index dcd9f7b126df..d0651bc63603 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -345,7 +345,7 @@ PDO_API void php_pdo_internal_construct_driver(INTERNAL_FUNCTION_PARAMETERS, zen } if (!strncmp(data_source, "uri:", sizeof("uri:")-1)) { - zend_error(E_DEPRECATED, "Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs"); + php_error_docref(NULL, E_DEPRECATED, "Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs"); if (EG(exception)) { RETURN_THROWS(); } diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt index d86f9b3d8773..6a742ae3d8af 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct_uri.phpt @@ -64,7 +64,7 @@ MySQLPDOTest::skip(); print "done!"; ?> --EXPECTF-- -Deprecated: Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs in %s on line %d +Deprecated: PDO::__construct(): Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs in %s on line %d -Deprecated: Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs in %s on line %d +Deprecated: PDO::__construct(): Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs in %s on line %d done! diff --git a/ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt b/ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt index 7fc686b21472..0a9d2999a005 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt @@ -41,8 +41,8 @@ var_dump(file_exists($dbFile)); --EXPECTF-- bool(false) -Deprecated: Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs in %s on line %d +Deprecated: PDO::__construct(): Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs in %s on line %d bool(true) bool(false) -ErrorException: Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs +ErrorException: PDO::__construct(): Looking up the DSN from a URI is deprecated due to possible security concerns with DSNs coming from remote URIs bool(false) From 351c8d26fe2b88396cd006e251fe034d9229c534 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 18:14:41 -0300 Subject: [PATCH 11/13] standard: remove zend_error usage in math --- ext/standard/math.c | 2 +- .../tests/math/base_convert_basic.phpt | 160 +++++++++--------- .../tests/math/base_convert_improvements.phpt | 12 +- .../tests/math/base_convert_variation1.phpt | 18 +- .../tests/math/bindec_basic_64bit.phpt | 22 +-- .../tests/math/bindec_variation1_64bit.phpt | 20 +-- ext/standard/tests/math/hexdec.phpt | 6 +- .../tests/math/hexdec_basic_64bit.phpt | 4 +- .../tests/math/hexdec_variation1_64bit.phpt | 16 +- .../tests/math/octdec_basic_64bit.phpt | 12 +- .../tests/math/octdec_variation1.phpt | 22 +-- 11 files changed, 147 insertions(+), 147 deletions(-) diff --git a/ext/standard/math.c b/ext/standard/math.c index e13f153f63e2..6dff27d6e05b 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -910,7 +910,7 @@ PHPAPI void _php_math_basetozval(zend_string *str, int base, zval *ret) } if (invalidchars > 0) { - zend_error(E_DEPRECATED, "Invalid characters passed for attempted conversion, these have been ignored"); + php_error_docref(NULL, E_DEPRECATED, "Invalid characters passed for attempted conversion, these have been ignored"); } if (mode == 1) { diff --git a/ext/standard/tests/math/base_convert_basic.phpt b/ext/standard/tests/math/base_convert_basic.phpt index bdef339f3b37..5109f4ede258 100644 --- a/ext/standard/tests/math/base_convert_basic.phpt +++ b/ext/standard/tests/math/base_convert_basic.phpt @@ -33,137 +33,137 @@ for ($f= 0; $f < count($frombase); $f++) { ......to base is 2 .........value= 10 res = 10 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 0 .........value= 10 res = 10 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 0 ......to base is 8 .........value= 10 res = 2 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 0 .........value= 10 res = 2 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 0 ......to base is 10 .........value= 10 res = 2 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 0 .........value= 10 res = 2 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 0 ......to base is 16 .........value= 10 res = 2 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 0 .........value= 10 res = 2 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 0 ......to base is 36 .........value= 10 res = 2 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 0 .........value= 10 res = 2 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 27 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 0 ...from base is 8 @@ -171,106 +171,106 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 10 res = 1000 .........value= 27 res = 10111 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 11 .........value= 3 res = 11 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 101 .........value= 10 res = 1000 .........value= 27 res = 10111 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 11 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 101 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 11 ......to base is 8 .........value= 10 res = 10 .........value= 27 res = 27 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 3 .........value= 3 res = 3 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 5 .........value= 10 res = 10 .........value= 27 res = 27 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 3 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 5 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 10 .........value= 10 res = 8 .........value= 27 res = 23 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 3 .........value= 3 res = 3 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 5 .........value= 10 res = 8 .........value= 27 res = 23 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 3 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 5 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 16 .........value= 10 res = 8 .........value= 27 res = 17 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 3 .........value= 3 res = 3 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 5 .........value= 10 res = 8 .........value= 27 res = 17 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 3 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 5 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 36 .........value= 10 res = 8 .........value= 27 res = n -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 3 .........value= 3 res = 3 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 95 res = 5 .........value= 10 res = 8 .........value= 27 res = n -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 39 res = 3 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 5 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ...from base is 10 @@ -284,10 +284,10 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 27 res = 11011 .........value= 39 res = 100111 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 101 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 11 ......to base is 8 .........value= 10 res = 12 @@ -299,10 +299,10 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 27 res = 33 .........value= 39 res = 47 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 5 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 10 .........value= 10 res = 10 @@ -314,10 +314,10 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 27 res = 27 .........value= 39 res = 39 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 5 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 16 .........value= 10 res = a @@ -329,10 +329,10 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 27 res = 1b .........value= 39 res = 27 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 5 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 36 .........value= 10 res = a @@ -344,10 +344,10 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 27 res = r .........value= 39 res = 13 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 5F res = 5 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ...from base is 16 @@ -362,7 +362,7 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 39 res = 111001 .........value= 5F res = 1011111 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 11 ......to base is 8 .........value= 10 res = 20 @@ -375,7 +375,7 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 39 res = 71 .........value= 5F res = 137 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 10 .........value= 10 res = 16 @@ -388,7 +388,7 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 39 res = 57 .........value= 5F res = 95 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 16 .........value= 10 res = 10 @@ -401,7 +401,7 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 39 res = 39 .........value= 5F res = 5f -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ......to base is 36 .........value= 10 res = g @@ -414,7 +414,7 @@ Deprecated: Invalid characters passed for attempted conversion, these have been .........value= 39 res = 1l .........value= 5F res = 2n -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d .........value= 3XYZ res = 3 ...from base is 36 diff --git a/ext/standard/tests/math/base_convert_improvements.phpt b/ext/standard/tests/math/base_convert_improvements.phpt index eccf98853cfc..49e387d533c2 100644 --- a/ext/standard/tests/math/base_convert_improvements.phpt +++ b/ext/standard/tests/math/base_convert_improvements.phpt @@ -33,15 +33,15 @@ echo base_convert("0 0" , 9, 10) . "\n"; 7 10 ======================================= -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 15 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 61695 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 511 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 0 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 7 -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d 0 diff --git a/ext/standard/tests/math/base_convert_variation1.phpt b/ext/standard/tests/math/base_convert_variation1.phpt index fd06465ab574..1dbce1e7fcf8 100644 --- a/ext/standard/tests/math/base_convert_variation1.phpt +++ b/ext/standard/tests/math/base_convert_variation1.phpt @@ -75,7 +75,7 @@ string(2) "14" -- Iteration 4 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(2) "14" -- Iteration 5 -- @@ -83,27 +83,27 @@ string(11) "17777777777" -- Iteration 6 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(3) "151" -- Iteration 7 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(3) "151" -- Iteration 8 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(7) "4553207" -- Iteration 9 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(7) "4553207" -- Iteration 10 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(1) "5" -- Iteration 11 -- @@ -129,17 +129,17 @@ base_convert(): Argument #1 ($num) must be of type string, array given -- Iteration 18 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(1) "0" -- Iteration 19 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(1) "0" -- Iteration 20 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: base_convert(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d string(1) "0" -- Iteration 21 -- diff --git a/ext/standard/tests/math/bindec_basic_64bit.phpt b/ext/standard/tests/math/bindec_basic_64bit.phpt index 8fece221c0ed..10095fa06c09 100644 --- a/ext/standard/tests/math/bindec_basic_64bit.phpt +++ b/ext/standard/tests/math/bindec_basic_64bit.phpt @@ -36,41 +36,41 @@ for ($i = 0; $i < count($values); $i++) { --EXPECTF-- int(455) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(32766) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(5) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(129) int(455) int(224) int(2147483647) int(2147483648) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(129) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(13) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(13) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(26) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(6) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) int(1) int(0) diff --git a/ext/standard/tests/math/bindec_variation1_64bit.phpt b/ext/standard/tests/math/bindec_variation1_64bit.phpt index 56bbbd35649b..1ea1a4fa964e 100644 --- a/ext/standard/tests/math/bindec_variation1_64bit.phpt +++ b/ext/standard/tests/math/bindec_variation1_64bit.phpt @@ -75,37 +75,37 @@ int(1) -- Iteration 3 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(1) -- Iteration 4 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -- Iteration 5 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(2) -- Iteration 6 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(2) -- Iteration 7 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(8) -- Iteration 8 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(1) -- Iteration 9 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -- Iteration 10 -- @@ -131,17 +131,17 @@ bindec(): Argument #1 ($binary_string) must be of type string, array given -- Iteration 17 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -- Iteration 18 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -- Iteration 19 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: bindec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -- Iteration 20 -- diff --git a/ext/standard/tests/math/hexdec.phpt b/ext/standard/tests/math/hexdec.phpt index 1f8b57d83fd0..777e5a654f7d 100644 --- a/ext/standard/tests/math/hexdec.phpt +++ b/ext/standard/tests/math/hexdec.phpt @@ -18,13 +18,13 @@ var_dump(hexdec("17fffffffffffffff")); int(74565) int(74565) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(74565) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(74565) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(74565) Notice: Input number is larger than PHP_INT_MAX, precision has been lost in conversion in %s on line %d diff --git a/ext/standard/tests/math/hexdec_basic_64bit.phpt b/ext/standard/tests/math/hexdec_basic_64bit.phpt index fd6d53b60198..1364d9f07ed7 100644 --- a/ext/standard/tests/math/hexdec_basic_64bit.phpt +++ b/ext/standard/tests/math/hexdec_basic_64bit.phpt @@ -62,7 +62,7 @@ int(2147483648) -- hexdec 0x123XYZABC -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(1194684) -- hexdec 311015 -- @@ -73,7 +73,7 @@ int(3215381) -- hexdec 31101.3 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(3215379) -- hexdec 3110130 -- diff --git a/ext/standard/tests/math/hexdec_variation1_64bit.phpt b/ext/standard/tests/math/hexdec_variation1_64bit.phpt index c892b8049fc9..ab39d37b2124 100644 --- a/ext/standard/tests/math/hexdec_variation1_64bit.phpt +++ b/ext/standard/tests/math/hexdec_variation1_64bit.phpt @@ -82,7 +82,7 @@ int(74565) -- Iteration 4 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(9029) -- Iteration 5 -- @@ -93,12 +93,12 @@ int(285960729238) -- Iteration 7 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(261) -- Iteration 8 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(261) -- Iteration 9 -- @@ -106,12 +106,12 @@ int(20015998341120) -- Iteration 10 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(1250999896553) -- Iteration 11 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(5) -- Iteration 12 -- @@ -137,17 +137,17 @@ hexdec(): Argument #1 ($hex_string) must be of type string, array given -- Iteration 19 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(2748) -- Iteration 20 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(2748) -- Iteration 21 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: hexdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(2748) -- Iteration 22 -- diff --git a/ext/standard/tests/math/octdec_basic_64bit.phpt b/ext/standard/tests/math/octdec_basic_64bit.phpt index 4051d9be6323..a435377b73e4 100644 --- a/ext/standard/tests/math/octdec_basic_64bit.phpt +++ b/ext/standard/tests/math/octdec_basic_64bit.phpt @@ -35,17 +35,17 @@ for ($i = 0; $i < count($values); $i++) { --EXPECTF-- *** Testing octdec() : basic functionality *** -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(14489) int(253) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(36947879) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(4618484) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(4104) int(5349) int(342391) @@ -53,11 +53,11 @@ int(375) int(2147483647) int(2147483648) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(668) int(5349) -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(102923) int(823384) int(1) diff --git a/ext/standard/tests/math/octdec_variation1.phpt b/ext/standard/tests/math/octdec_variation1.phpt index c24d2e8e6bea..366c31b8a83b 100644 --- a/ext/standard/tests/math/octdec_variation1.phpt +++ b/ext/standard/tests/math/octdec_variation1.phpt @@ -79,42 +79,42 @@ int(5349) -- Iteration 4 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(1253) -- Iteration 5 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(1134037) -- Iteration 6 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(1134038) -- Iteration 7 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(69) -- Iteration 8 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(69) -- Iteration 9 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(175304192) -- Iteration 10 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(342391) -- Iteration 11 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(5) -- Iteration 12 -- @@ -140,17 +140,17 @@ octdec(): Argument #1 ($octal_string) must be of type string, array given -- Iteration 19 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -- Iteration 20 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -- Iteration 21 -- -Deprecated: Invalid characters passed for attempted conversion, these have been ignored in %s on line %d +Deprecated: octdec(): Invalid characters passed for attempted conversion, these have been ignored in %s on line %d int(0) -- Iteration 22 -- From 8a87c0b3cb3b40ab4eec34d4b15373d1ec38753f Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 29 Jul 2026 18:29:10 -0300 Subject: [PATCH 12/13] pdo_sqlite: remove zend_error usage --- ext/pdo_sqlite/pdo_sqlite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c index 2da9329e2a04..468cfbd07541 100644 --- a/ext/pdo_sqlite/pdo_sqlite.c +++ b/ext/pdo_sqlite/pdo_sqlite.c @@ -307,7 +307,7 @@ PHP_METHOD(Pdo_Sqlite, openBlob) sqlite_flags = (flags & SQLITE_OPEN_READWRITE) ? 1 : 0; if (sqlite3_blob_open(sqlite_handle, dbname, table, column, rowid, sqlite_flags, &blob) != SQLITE_OK) { - zend_error(E_WARNING, "Unable to open blob: %s", sqlite3_errmsg(sqlite_handle)); + php_error_docref(NULL, E_WARNING, "Unable to open blob: %s", sqlite3_errmsg(sqlite_handle)); RETURN_FALSE; } From 6a518e4b61ac37232b2d3d24ddc01788fcfebab4 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Thu, 30 Jul 2026 11:22:41 -0300 Subject: [PATCH 13/13] standard: browscap ini docref --- ext/standard/browscap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index d91cb3b5df6b..46d0eb3f043b 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -333,7 +333,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb if (ctx->current_section_name != NULL && zend_string_equals_ci(ctx->current_section_name, Z_STR_P(arg2)) ) { - php_error_docref(NULL, E_CORE_ERROR, "Invalid browscap ini file: " + php_error_docref("misc.configuration.php#ini.browscap", E_CORE_ERROR, "Invalid browscap ini file: " "'Parent' value cannot be same as the section name: %s " "(in file %s)", ZSTR_VAL(ctx->current_section_name), zend_ini_string_literal("browscap")); return;