Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0e472f5

Browse files
committed
Fix for CDbebug VIEW VARIABLES
1 parent bc9267b commit 0e472f5

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

‎framework/core/CDebug.php

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,34 @@ function appExpandTabs(act, key){
623623
$output .= $htmlCompression ? nl2br($arrUserConstants) : $arrUserConstants;
624624
$output .= '</pre>';
625625
$output .= '<br>';
626-
627-
$output .= '<strong>VIEW VARIABLES</strong>:';
628-
$output .= '<pre style="white-space:pre-wrap;">';
629-
$arrViewVars = A::app()->view->getAllVars();
630-
$arrViewVars = print_r(@array_map('htmlspecialchars', $arrViewVars), true);
631-
$output .= $htmlCompression ? nl2br($arrViewVars) : $arrViewVars;
632-
$output .= '</pre>';
633-
$output .= '<br>';
626+
627+
$output .= '<strong>VIEW VARIABLES</strong>:';
628+
$output .= '<pre style="white-space:pre-wrap;">';
629+
$arrViewVars = A::app()->view->getAllVars();
630+
631+
$arrViewVarsTemp = [];
632+
foreach ($arrViewVars as $arrViewVar) {
633+
if (is_string($arrViewVar)) {
634+
$arrViewVarsTemp[] = htmlspecialchars($arrViewVar);
635+
} else {
636+
$arrViewVarsTemp[] = $arrViewVar;
637+
}
638+
}
639+
$arrViewVars = $arrViewVarsTemp;
640+
641+
$arrViewVarsTemp = [];
642+
foreach ($arrViewVars as $arrViewVar) {
643+
if ($htmlCompression && is_string($arrViewVar)) {
644+
$arrViewVarsTemp[] = nl2br($arrViewVar);
645+
} else {
646+
$arrViewVarsTemp[] = $arrViewVar;
647+
}
648+
}
649+
$arrViewVars = $arrViewVarsTemp;
650+
651+
$output .= print_r($arrViewVars, true);
652+
$output .= '</pre>';
653+
$output .= '<br>';
634654

635655
$output .= '</div>
636656

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /