BUGFIX Consistently using multibyte-safe htmlentities()

This commit is contained in:
Ingo Schommer 2011-11-29 10:43:06 +01:00
parent 1fec67e5af
commit 3a7ac9759a
4 changed files with 6 additions and 6 deletions

View File

@ -173,7 +173,7 @@ class SS_Backtrace {
}
$result .= "<li><b>" . htmlentities($name, ENT_COMPAT, 'UTF-8') . "</b>\n<br />\n";
$result .= isset($item['line']) ? "Line $item[line] of " : '';
$result .= isset($item['file']) ? htmlentities(basename($item['file'])) : '';
$result .= isset($item['file']) ? htmlentities(basename($item['file']), ENT_COMPAT, 'UTF-8') : '';
$result .= "</li>\n";
}
}

View File

@ -141,7 +141,7 @@ class Debug {
$val = '(bool) ' . $val;
} else {
if(!Director::is_cli() && !Director::is_ajax()) {
$val = "<pre style=\"font-family: Courier new\">" . htmlentities($val) . "</pre>\n";
$val = "<pre style=\"font-family: Courier new\">" . htmlentities($val, ENT_COMPAT, 'UTF-8') . "</pre>\n";
}
}

View File

@ -126,7 +126,7 @@ class DebugView extends Object {
*/
public function writeError($httpRequest, $errno, $errstr, $errfile, $errline, $errcontext) {
$errorType = self::$error_types[$errno];
$httpRequestEnt = htmlentities($httpRequest);
$httpRequestEnt = htmlentities($httpRequest, ENT_COMPAT, 'UTF-8');
echo '<div class="info ' . $errorType['class'] . '">';
echo "<h1>[" . $errorType['title'] . '] ' . strip_tags($errstr) . "</h1>";
echo "<h3>$httpRequestEnt</h3>";

View File

@ -469,7 +469,7 @@ class InstallRequirements {
if($this->errors) {
echo "<p>The following problems are preventing me from installing SilverStripe CMS:</p>\n\n";
foreach($this->errors as $error) {
echo "<li>" . htmlentities(implode(", ", $error)) . "</li>\n";
echo "<li>" . htmlentities(implode(", ", $error), ENT_COMPAT, 'UTF-8') . "</li>\n";
}
}
}
@ -480,7 +480,7 @@ class InstallRequirements {
$id = strtolower(str_replace(' ', '_', $section));
echo "<table id=\"{$id}_results\" class=\"testResults\" width=\"100%\">";
foreach($tests as $test => $result) {
echo "<tr class=\"$result[0]\"><td>$test</td><td>" . nl2br(htmlentities($result[1])) . "</td></tr>";
echo "<tr class=\"$result[0]\"><td>$test</td><td>" . nl2br(htmlentities($result[1]), ENT_COMPAT, 'UTF-8') . "</td></tr>";
}
echo "</table>";
@ -502,7 +502,7 @@ class InstallRequirements {
break;
}
}
$output .= "<tr class=\"$result[0]\"><td>$test</td><td>" . nl2br(htmlentities($result[1])) . "</td></tr>";
$output .= "<tr class=\"$result[0]\"><td>$test</td><td>" . nl2br(htmlentities($result[1], ENT_COMPAT, 'UTF-8')) . "</td></tr>";
}
$className = "good";
$text = "All Requirements Pass";