From: Dmitry Stogov Date: Wed, 26 Aug 2009 14:05:48 +0000 (+0000) Subject: Fixed bug #47273 (Encoding bug in SoapServer->fault) X-Git-Tag: php-5.4.0alpha1~191^2~2753 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0afbfb5098dac7813d276f2ba4d2049fa3260ed;p=php Fixed bug #47273 (Encoding bug in SoapServer->fault) --- diff --git a/ext/soap/tests/bugs/bug47273.phpt b/ext/soap/tests/bugs/bug47273.phpt new file mode 100644 index 0000000000..174948f59f --- /dev/null +++ b/ext/soap/tests/bugs/bug47273.phpt @@ -0,0 +1,53 @@ +--TEST-- +Bug #47273 (Encoding bug in SoapServer->fault) +--SKIPIF-- + +--INI-- +unicode.script_encoding=ISO-8859-1 +unicode.output_encoding=ISO-8859-1 +--FILE-- + + +EOF; +$request2 = << + +EOF; + +class SoapFaultTest +{ + public function test1() { + // Test #1 + return 'Test #1 exception with some special chars: Äßö'; + } + public function test2() { + // Test #2 + //throw new SoapFault('Server', 'Test #2 exception with some special chars: Äßö'); + throw new Exception('Test #2 exception with some special chars: Äßö'); + } +} + +$server = new SoapServer(null, array( +'uri' => "http://127.0.0.1:8080/test/", +'encoding' => 'ISO-8859-1')); +$server->setClass('SoapFaultTest'); + +try { + $server->handle($request1); +} catch (Exception $e) { + $server->fault("Sender", $e->getMessage()); +} +try { + $server->handle($request2); +} catch (Exception $e) { + $server->fault("Sender", $e->getMessage()); +} +?> +--EXPECT-- + +Test #1 exception with some special chars: Äßö + +SenderTest #2 exception with some special chars: Äßö +