Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

dump函数中htmlspecialchars增加编码设定,修复遇到中文非utf8编码无输出bug #466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ThinkPHP/Common/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ function dump($var, $echo = true, $label = null, $strict = true)
if (!$strict) {
if (ini_get('html_errors')) {
$output = print_r($var, true);
$output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>';
$output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES, 'ISO-8859-1') . '</pre>';
} else {
$output = $label . print_r($var, true);
}
Expand All @@ -929,7 +929,7 @@ function dump($var, $echo = true, $label = null, $strict = true)
$output = ob_get_clean();
if (!extension_loaded('xdebug')) {
$output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output);
$output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>';
$output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES, 'ISO-8859-1') . '</pre>';
}
}
if ($echo) {
Expand Down