From ea06c5da612ead7d20c91d851ddd0104ccaba458 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 20 Aug 2016 15:06:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bdebug=E7=B1=BB=E7=9A=84dump?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Debug.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/think/Debug.php b/library/think/Debug.php index 28b6ab1e..e69ab86a 100644 --- a/library/think/Debug.php +++ b/library/think/Debug.php @@ -159,9 +159,10 @@ class Debug * @param mixed $var 变量 * @param boolean $echo 是否输出 默认为true 如果为false 则返回输出字符串 * @param string $label 标签 默认为空 + * @param integer $flags htmlspecialchars flags * @return void|string */ - public static function dump($var, $echo = true, $label = null) + public static function dump($var, $echo = true, $label = null, $flags = ENT_SUBSTITUTE) { $label = (null === $label) ? '' : rtrim($label) . ':'; ob_start(); @@ -172,7 +173,7 @@ class Debug $output = PHP_EOL . $label . $output . PHP_EOL; } else { if (!extension_loaded('xdebug')) { - $output = htmlspecialchars($output, ENT_QUOTES); + $output = htmlspecialchars($output, $flags); } $output = '
' . $label . $output . '
'; }