Improve example regarding valid HTML

This integrated user note 125348.  Also, there is no need to `break` after `exit`ing.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350547 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2020-09-11 12:39:38 +00:00
parent 70528fcff5
commit f29b00cccf

View file

@ -230,6 +230,9 @@ function myErrorHandler($errno, $errstr, $errfile, $errline)
return false;
}
// $errstr may need to be escaped:
$errstr = htmlspecialchars($errstr);
switch ($errno) {
case E_USER_ERROR:
echo "<b>My ERROR</b> [$errno] $errstr<br />\n";
@ -237,7 +240,6 @@ function myErrorHandler($errno, $errstr, $errfile, $errline)
echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
echo "Aborting...<br />\n";
exit(1);
break;
case E_USER_WARNING:
echo "<b>My WARNING</b> [$errno] $errstr<br />\n";