bug42214.phpt 1.0 KB

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #42214 (SoapServer sends clients internal PHP errors)
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. $request = <<<EOF
  8. <?xml version="1.0" encoding="UTF-8"?>
  9. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost/server.php" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
  10. EOF;
  11. function test() {
  12. $a = $b;
  13. obvious_error(); // will cause an error
  14. }
  15. $server = new SoapServer(NULL, array('uri' =>'http://localhost/server.php',
  16. 'send_errors'=>0));
  17. $server->addFunction('test');
  18. $server->handle($request);
  19. ?>
  20. --EXPECT--
  21. <?xml version="1.0" encoding="UTF-8"?>
  22. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Internal Error</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>