]> granicus.if.org Git - php/commitdiff
Fixed bug #51273 (Faultstring property does not exist when the faultstring is empty)
authorIlia Alshanetsky <iliaa@php.net>
Wed, 9 Jun 2010 15:48:22 +0000 (15:48 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 9 Jun 2010 15:48:22 +0000 (15:48 +0000)
# Patch by dennis at transip dot nl

ext/soap/soap.c

index c27b9d06a8098ec58ad1fb6e286a13a70af7c59b..3c7650e195301ef160b5e06ab6ab6c3144c146a1 100644 (file)
@@ -3372,12 +3372,12 @@ static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, cha
        if (Z_TYPE_P(obj) != IS_OBJECT) {
                object_init_ex(obj, soap_fault_class_entry);
        }
-       if (fault_string != NULL) {
-               add_property_string(obj, "faultstring", fault_string, 1);
+       
+       add_property_string(obj, "faultstring", fault_string ? fault_string : "", 1);
 #ifdef ZEND_ENGINE_2
-               zend_update_property_string(zend_exception_get_default(TSRMLS_C), obj, "message", sizeof("message")-1, fault_string TSRMLS_CC);
+       zend_update_property_string(zend_exception_get_default(TSRMLS_C), obj, "message", sizeof("message")-1, (fault_string ? fault_string : "") TSRMLS_CC);
 #endif
-       }
+       
        if (fault_code != NULL) {
                int soap_version = SOAP_GLOBAL(soap_version);