note 113866 added to soapserver.handle
| From: | JoeriThissen | Date: | Wed, 11 Dec 2013 10:59:11 +0000 |
| Subject: | note 113866 added to soapserver.handle | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197903@lists.php.net to get a copy of this message | ||
Sometimes returned data can contain characters which are not valid in xml 1.0. This causes the xml
being output by SoapServer::handle to be invalid. Although it's probably better to sanitize the
data ealier, a combination of output buffering and a simple regular expression can be used as a
quick fix to make sure the output is indeed valid xml.
For example:
<?php
ob_start();
$soapServer->handle();
$soapXml = ob_get_contents();
ob_end_clean();
$soapXml = preg_replace
('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ',
$soapXml);
echo $soapXml;
?>
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/soapserver.handle.php
Edit -- https://master.php.net/note/edit/113866
Del: integrated -- https://master.php.net/note/delete/113866/integrated
Del: useless -- https://master.php.net/note/delete/113866/useless
Del: bad code -- https://master.php.net/note/delete/113866/bad+code
Del: spam -- https://master.php.net/note/delete/113866/spam
Del: non-english -- https://master.php.net/note/delete/113866/non-english
Del: in docs -- https://master.php.net/note/delete/113866/in+docs
Del: other reasons-- https://master.php.net/note/delete/113866
Reject -- https://master.php.net/note/reject/113866
Search -- https://master.php.net/manage/user-notes.php