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

@@ -141,7 +141,7 @@ else {
$title=str_replace("#","",$hydrop[0]);
$title=str_replace("\r","",$title);
$source="";
echo "<hr>".htmlentities($file_name." $title $source");
echo "<hr>".htmlspecialchars($file_name." $title $source");
$regex = '/<(?!div)/';
// $file_content = preg_replace($regex, '',$file_content);
$regex = '/(?<!div)>\s?/';
@@ -156,10 +156,10 @@ else {
if($save_path){
$description=str_replace("file://",$save_path."/",$description);
// echo htmlentities($description);
// echo htmlspecialchars($description);
}
//echo htmlentities("$description");
//echo htmlspecialchars("$description");
$tail=0;
$ptitle = $title;
while (hasProblem($ptitle)) {
@@ -170,7 +170,7 @@ else {
$pid = addproblem($title,1,128, $description, $input, $output, $sample_input, $sample_output, $hint, $source, $spj, $OJ_DATA);
mkdir($OJ_DATA."/$pid/");
echo "PID:<a href='../problem.php?id=$pid' >".htmlentities($title,ENT_QUOTES,"UTF-8")."</a>";
echo "PID:<a href='../problem.php?id=$pid' >".htmlspecialchars($title,ENT_QUOTES,"UTF-8")."</a>";
}
}
}else{