[PHP-CVS] cvs: php-src /ext/soap soap.c /ext/soap/tests/bugs bug31755.phpt

2008-09-08 Thread Felipe Pena
felipe  Mon Sep  8 19:34:48 2008 UTC

  Modified files:  
/php-src/ext/soap   soap.c 
/php-src/ext/soap/tests/bugsbug31755.phpt 
  Log:
  - Changed error level E_ERROR into E_WARNING in parameter validation
  http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.249&r2=1.250&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.249 php-src/ext/soap/soap.c:1.250
--- php-src/ext/soap/soap.c:1.249   Sun Sep  7 02:51:19 2008
+++ php-src/ext/soap/soap.c Mon Sep  8 19:34:48 2008
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.249 2008/09/07 02:51:19 felipe Exp $ */
+/* $Id: soap.c,v 1.250 2008/09/08 19:34:48 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1135,7 +1135,8 @@
return;
}
if (name_length == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameter 
name");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter 
name");
+   return;
}
 
if (name_type == IS_STRING) {
@@ -1164,10 +1165,12 @@
return;
}
if (ns_len == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid namespace");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 
namespace");
+   return;
}
if (name_len == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid header 
name");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid header 
name");
+   return;
}
 
if (ns_type == IS_STRING) {
@@ -1195,7 +1198,8 @@
} else if (Z_TYPE_P(actor) == IS_UNICODE && Z_USTRLEN_P(actor) > 0) {
add_property_unicodel(this_ptr, "actor", Z_USTRVAL_P(actor), 
Z_USTRLEN_P(actor), 1);
} else {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid actor");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid actor");
+   return;
}
 }
 
@@ -1236,13 +1240,16 @@
fault_code_ns = soap_encode_string(*t_ns, NULL 
TSRMLS_CC);
fault_code = soap_encode_string(*t_code, NULL 
TSRMLS_CC);
} else {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 
fault code");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 
fault code");
+   return;
}
} else  {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid fault code");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault 
code");
+   return;
}
if (fault_code != NULL && !fault_code[0]) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid fault code");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault 
code");
+   return;
}
if (name.v != NULL && name_len == 0) {
name.v = NULL;
@@ -1353,7 +1360,8 @@
if (zend_hash_index_exists(&SOAP_GLOBAL(defEncIndex), 
Z_LVAL_P(type))) {
add_property_long(this_ptr, "enc_type", Z_LVAL_P(type));
} else {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid type 
ID");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 
type ID");
+   return;
}
}
 
@@ -1411,7 +1419,8 @@
encodePtr enc, new_enc;
 
if (Z_TYPE_PP(tmp) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrong 
'typemap' option");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong 
'typemap' option");
+   return;
}
ht2 = Z_ARRVAL_PP(tmp);
 
@@ -1592,7 +1601,8 @@
}
encoding = xmlFindCharEncodingHandler(str);
if (encoding == NULL) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, 
"Invalid arguments. Invalid 'encoding' option - '%v'", Z_TYPE_PP(tmp), 
Z_UNIVAL_PP(tmp));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Invalid arguments. Invalid 'encoding' option - '%v'", Z_TYPE_PP(tmp), 
Z_UNIVAL_PP(tmp));
+   return;
} else {
service->encoding = encoding;
}
@@ -1633,7 +1643,7 @@
}
 
if (wsdl == NULL && service->uri == NULL) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments. 
'uri' option is required in nonWSDL mode");
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments. 
'uri' option

[PHP-CVS] cvs: php-src /ext/soap soap.c /ext/soap/tests/bugs bug31755.phpt

2008-09-06 Thread Felipe Pena
felipe  Sun Sep  7 02:51:19 2008 UTC

  Modified files:  
/php-src/ext/soap   soap.c 
/php-src/ext/soap/tests/bugsbug31755.phpt 
  Log:
  - Removed the doubled error message (the error level is no longer E_ERROR)
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.248&r2=1.249&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.248 php-src/ext/soap/soap.c:1.249
--- php-src/ext/soap/soap.c:1.248   Mon Sep  1 14:55:42 2008
+++ php-src/ext/soap/soap.c Sun Sep  7 02:51:19 2008
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.248 2008/09/01 14:55:42 dmitry Exp $ */
+/* $Id: soap.c,v 1.249 2008/09/07 02:51:19 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1132,10 +1132,10 @@
zend_uchar name_type;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zt", &data, 
&name, &name_length, &name_type) == FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+   return;
}
if (name_length == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. 
Invalid parameter name");
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameter 
name");
}
 
if (name_type == IS_STRING) {
@@ -1161,13 +1161,13 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tt|zbz",
&ns, &ns_len, &ns_type, &name, &name_len, &name_type,
&data, &must_understand, &actor) == FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+   return;
}
if (ns_len == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. 
Invalid namespace");
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid namespace");
}
if (name_len == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. 
Invalid header name");
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid header 
name");
}
 
if (ns_type == IS_STRING) {
@@ -1195,7 +1195,7 @@
} else if (Z_TYPE_P(actor) == IS_UNICODE && Z_USTRLEN_P(actor) > 0) {
add_property_unicodel(this_ptr, "actor", Z_USTRVAL_P(actor), 
Z_USTRLEN_P(actor), 1);
} else {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. 
Invalid actor");
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid actor");
}
 }
 
@@ -1218,7 +1218,7 @@
&details,
&name, &name_len, &name_type,
&headerfault) == FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+   return;
}
 
if (Z_TYPE_P(code) == IS_NULL) {
@@ -1236,13 +1236,13 @@
fault_code_ns = soap_encode_string(*t_ns, NULL 
TSRMLS_CC);
fault_code = soap_encode_string(*t_code, NULL 
TSRMLS_CC);
} else {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 
parameters. Invalid fault code");
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 
fault code");
}
} else  {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. 
Invalid fault code");
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid fault code");
}
if (fault_code != NULL && !fault_code[0]) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters. 
Invalid fault code");
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid fault code");
}
if (name.v != NULL && name_len == 0) {
name.v = NULL;
@@ -1344,7 +1344,7 @@
&ns, &ns_len, &ns_type,
&name, &name_len, &name_type,
&namens, &namens_len, &namens_type) == FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+   return;
}
 
if (Z_TYPE_P(type) == IS_NULL) {
@@ -1525,7 +1525,10 @@
 PHP_METHOD(SoapServer, SoapServer)
 {
soap_server_object *service;
-   zval *zwsdl, *options = NULL;
+   zval *options = NULL;
+   zstr zwsdl = NULL_ZSTR;
+   int zwsdl_len;
+   zend_uchar zwsdl_type;
char *wsdl = NULL;
int version = SOAP_1_1;
zend_bool cache_wsdl;
@@ -1533,18 +1536,16 @@
 
SOAP_SERVER_BEGIN_CODE();
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &zwsdl, 
&options) == FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t!|a", &zwsdl,