From d0afbfb5098dac7813d276f2ba4d2049fa3260ed Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 26 Aug 2009 14:05:48 +0000 Subject: [PATCH] Fixed bug #47273 (Encoding bug in SoapServer->fault) --- ext/soap/tests/bugs/bug47273.phpt | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 ext/soap/tests/bugs/bug47273.phpt 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: Äßö + -- 2.50.1