htmlentities -> htmlspecialchars

This commit is contained in:
2024-12-06 15:35:38 +08:00
parent daa005f029
commit d9b2d13caa
184 changed files with 410 additions and 405 deletions

View File

@@ -61,7 +61,7 @@ foreach ($result as $row) {
$label_theme = $color_theme[$hash_num%count($color_theme)]; //$color_theme 在 const.inc.php 里
if ($label_theme=="")
$label_theme = "default";
$view_problemset[$i][3] .= "<a title='".htmlentities($cat,ENT_QUOTES,'UTF-8')."' class='label label-$label_theme' style='display: inline-block;' href='problemset.php?search=".htmlentities(urlencode($cat),ENT_QUOTES,'UTF-8')."'>".mb_substr($cat,0,10,'utf8')."</a>&nbsp;";
$view_problemset[$i][3] .= "<a title='".htmlspecialchars($cat,ENT_QUOTES,'UTF-8')."' class='label label-$label_theme' style='display: inline-block;' href='problemset.php?search=".htmlspecialchars(urlencode($cat),ENT_QUOTES,'UTF-8')."'>".mb_substr($cat,0,10,'utf8')."</a>&nbsp;";
}
$view_problemset[$i][3] .= "</div >";
@@ -116,7 +116,7 @@ foreach ($result as $row) {
}
$sql = "SELECT * FROM contest WHERE contest.defunct='N' $wheremy ORDER BY contest_id DESC";
//echo htmlentities($sql);
//echo htmlspecialchars($sql);
$result = pdo_query($sql);
$view_contest=array();
foreach ($result as $row) {