Skip to content

Commit e817b94

Browse files
author
Yoshinari Takaoka
committed
Improve example regarding valid HTML
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@350548 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent c9fc6b3 commit e817b94

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

reference/errorfunc/functions/set-error-handler.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 0007fca77fdcf4629fee80e1f0b86958b7df67b5 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: f29b00cccf92e39e42a19c069c60764ba8431858 Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa,mumumu -->
55
<refentry xml:id="function.set-error-handler" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -238,14 +238,16 @@ function myErrorHandler($errno, $errstr, $errfile, $errline)
238238
return;
239239
}
240240
241+
// $errstr はエスケープする必要があるかもしれません。
242+
$errstr = htmlspecialchars($errstr);
243+
241244
switch ($errno) {
242245
case E_USER_ERROR:
243246
echo "<b>My ERROR</b> [$errno] $errstr<br />\n";
244247
echo " Fatal error on line $errline in file $errfile";
245248
echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
246249
echo "Aborting...<br />\n";
247250
exit(1);
248-
break;
249251
250252
case E_USER_WARNING:
251253
echo "<b>My WARNING</b> [$errno] $errstr<br />\n";

0 commit comments

Comments
 (0)