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

@@ -49,7 +49,7 @@ include_once("kindeditor.php") ;
<p align=left>
<center>
<h3>
<?php echo $row['problem_id']?>: <input class="input input-xxlarge" style='width:90%' type=text name=title value='<?php echo htmlentities($row['title'],ENT_QUOTES,"UTF-8")?>'>
<?php echo $row['problem_id']?>: <input class="input input-xxlarge" style='width:90%' type=text name=title value='<?php echo htmlspecialchars($row['title'],ENT_QUOTES,"UTF-8")?>'>
</h3>
</center>
</p>
@@ -61,32 +61,32 @@ include_once("kindeditor.php") ;
</p>
<p align=left>
<?php echo "<h4>".$MSG_Description."</h4>"?>
<textarea class="kindeditor" rows=13 name=description cols=80><?php echo htmlentities($row['description'],ENT_QUOTES,"UTF-8")?></textarea><br>
<textarea class="kindeditor" rows=13 name=description cols=80><?php echo htmlspecialchars($row['description'],ENT_QUOTES,"UTF-8")?></textarea><br>
</p>
<p align=left>
<?php echo "<h4>".$MSG_Input."</h4>"?>
<textarea class="kindeditor" rows=13 name=input cols=80><?php echo htmlentities($row['input'],ENT_QUOTES,"UTF-8")?></textarea><br>
<textarea class="kindeditor" rows=13 name=input cols=80><?php echo htmlspecialchars($row['input'],ENT_QUOTES,"UTF-8")?></textarea><br>
</p>
<p align=left>
<?php echo "<h4>".$MSG_Output."</h4>"?>
<textarea class="kindeditor" rows=13 name=output cols=80><?php echo htmlentities($row['output'],ENT_QUOTES,"UTF-8")?></textarea><br>
<textarea class="kindeditor" rows=13 name=output cols=80><?php echo htmlspecialchars($row['output'],ENT_QUOTES,"UTF-8")?></textarea><br>
</p>
<p align=left>
<?php echo "<h4>".$MSG_Sample_Input."</h4>"?>
<textarea class="input input-large" style="width:100%;" rows=13 name=sample_input><?php echo htmlentities($row['sample_input'],ENT_QUOTES,"UTF-8")?></textarea><br><br>
<textarea class="input input-large" style="width:100%;" rows=13 name=sample_input><?php echo htmlspecialchars($row['sample_input'],ENT_QUOTES,"UTF-8")?></textarea><br><br>
</p>
<p align=left>
<?php echo "<h4>".$MSG_Sample_Output."</h4>"?>
<textarea class="input input-large" style="width:100%;" rows=13 name=sample_output><?php echo htmlentities($row['sample_output'],ENT_QUOTES,"UTF-8")?></textarea><br><br>
<textarea class="input input-large" style="width:100%;" rows=13 name=sample_output><?php echo htmlspecialchars($row['sample_output'],ENT_QUOTES,"UTF-8")?></textarea><br><br>
</p>
<p align=left>
<?php echo "<h4>".$MSG_HINT."</h4>"?>
<textarea class="kindeditor" rows=13 name=hint cols=80><?php echo htmlentities($row['hint'],ENT_QUOTES,"UTF-8")?></textarea><br>
<textarea class="kindeditor" rows=13 name=hint cols=80><?php echo htmlspecialchars($row['hint'],ENT_QUOTES,"UTF-8")?></textarea><br>
</p>
<p>
@@ -99,11 +99,11 @@ include_once("kindeditor.php") ;
<p align=left>
<?php echo "<h4>".$MSG_SOURCE." 用空格分隔"."</h4>"?>
<textarea name=source style="width:100%;" rows=1><?php echo htmlentities($row['source'],ENT_QUOTES,"UTF-8")?></textarea><br>
<textarea name=source style="width:100%;" rows=1><?php echo htmlspecialchars($row['source'],ENT_QUOTES,"UTF-8")?></textarea><br>
<?php echo "<h4>".$MSG_REMOTE_OJ."</h4>"?>
<input name=remote_oj value='<?php echo htmlentities($row['remote_oj'],ENT_QUOTES,"UTF-8")?>' placeholder='<?php echo $MSG_HELP_LOCAL_EMPTY ?>' >
<input name=remote_id value='<?php echo htmlentities($row['remote_id'],ENT_QUOTES,"UTF-8")?>' placeholder='<?php echo $MSG_HELP_LOCAL_EMPTY ?>' ><br>
<input name=remote_oj value='<?php echo htmlspecialchars($row['remote_oj'],ENT_QUOTES,"UTF-8")?>' placeholder='<?php echo $MSG_HELP_LOCAL_EMPTY ?>' >
<input name=remote_id value='<?php echo htmlspecialchars($row['remote_id'],ENT_QUOTES,"UTF-8")?>' placeholder='<?php echo $MSG_HELP_LOCAL_EMPTY ?>' ><br>
</p>
<div align=center>
@@ -237,19 +237,19 @@ include_once("kindeditor.php") ;
// $description = str_replace("<p>", "", $description);
// $description = str_replace("</p>", "<br />", $description);
// $description = str_replace(",", "&#44;", $description);
$description = html_entity_decode($description,ENT_QUOTES,"UTF-8");
$description = htmlspecialchars_decode($description,ENT_QUOTES,"UTF-8");
$input = $_POST['input'];
// $input = str_replace("<p>", "", $input);
// $input = str_replace("</p>", "<br />", $input);
// $input = str_replace(",", "&#44;", $input);
$input = html_entity_decode($input,ENT_QUOTES,"UTF-8");
$input = htmlspecialchars_decode($input,ENT_QUOTES,"UTF-8");
$output = $_POST['output'];
// $output = str_replace("<p>", "", $output);
// $output = str_replace("</p>", "<br />", $output);
// $output = str_replace(",", "&#44;", $output);
$output = html_entity_decode($output,ENT_QUOTES,"UTF-8");
$output = htmlspecialchars_decode($output,ENT_QUOTES,"UTF-8");
$sample_input = $_POST['sample_input'];
$sample_output = $_POST['sample_output'];
@@ -260,7 +260,7 @@ include_once("kindeditor.php") ;
// $hint = str_replace("<p>", "", $hint);
// $hint = str_replace("</p>", "<br />", $hint);
// $hint = str_replace(",", "&#44;", $hint);
$hint = html_entity_decode($hint,ENT_QUOTES,"UTF-8");
$hint = htmlspecialchars_decode($hint,ENT_QUOTES,"UTF-8");
$source = $_POST['source'];
$remote_oj= $_POST['remote_oj'];