From 522ff3468e1a98072075054042c3c698c4612178 Mon Sep 17 00:00:00 2001 From: klarkxy <278370456@qq.com> Date: Fri, 6 Dec 2024 15:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/admin/problem_add.php | 10 +++++----- web/admin/problem_edit.php | 11 ++++++----- web/admin/problem_export_xml.php | 2 +- web/bsadmin/problem_export_xml.php | 2 +- web/include/PHPMailer.php | 3 +-- web/swadmin/problem_export_xml.php | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/web/admin/problem_add.php b/web/admin/problem_add.php index 0d30065..66bcc84 100644 --- a/web/admin/problem_add.php +++ b/web/admin/problem_add.php @@ -13,7 +13,7 @@ require_once ("../include/problem.php"); // contest_id $title = $_POST['title']; // $title = str_replace(",", ",", $title); -$title = htmlspecialchars_decode($title, ENT_QUOTES, 'UTF-8'); +$title = htmlspecialchars_decode($title, ENT_QUOTES); $time_limit = $_POST['time_limit']; $memory_limit = $_POST['memory_limit']; @@ -21,19 +21,19 @@ $description = $_POST['description']; //$description = str_replace("

", "", $description); //$description = str_replace("

", "
", $description); // $description = str_replace(",", ",", $description); -$description = htmlspecialchars_decode($description, ENT_QUOTES, 'UTF-8'); +$description = htmlspecialchars_decode($description, ENT_QUOTES); $input = $_POST['input']; //$input = str_replace("

", "", $input); //$input = str_replace("

", "
", $input); // $input = str_replace(",", ",", $input); -$input = htmlspecialchars_decode($input, ENT_QUOTES, 'UTF-8'); +$input = htmlspecialchars_decode($input, ENT_QUOTES); $output = $_POST['output']; //$output = str_replace("

", "", $output); //$output = str_replace("

", "
", $output); // $output = str_replace(",", ",", $output); -$output = htmlspecialchars_decode($output, ENT_QUOTES, 'UTF-8'); +$output = htmlspecialchars_decode($output, ENT_QUOTES); $sample_input = $_POST['sample_input']; $sample_output = $_POST['sample_output']; @@ -49,7 +49,7 @@ $hint = $_POST['hint']; //$hint = str_replace("

", "", $hint); //$hint = str_replace("

", "
", $hint); // $hint = str_replace(",", ",", $hint); -$hint = htmlspecialchars_decode($hint, ENT_QUOTES, 'UTF-8'); +$hint = htmlspecialchars_decode($hint, ENT_QUOTES); $source = $_POST['source']; diff --git a/web/admin/problem_edit.php b/web/admin/problem_edit.php index 192f6d4..df62792 100644 --- a/web/admin/problem_edit.php +++ b/web/admin/problem_edit.php @@ -227,7 +227,8 @@ include_once("kindeditor.php") ; if (!(isset($_SESSION[$OJ_NAME.'_'."p$id"]) || isset($_SESSION[$OJ_NAME.'_'.'administrator']) || isset($_SESSION[$OJ_NAME.'_'.'problem_editor']) )) exit(); $title = $_POST['title']; - $title = str_replace(",", ",", $title); + // $title = str_replace(",", ",", $title); + $title = htmlspecialchars_decode($title,ENT_QUOTES); $time_limit = $_POST['time_limit']; @@ -237,19 +238,19 @@ include_once("kindeditor.php") ; // $description = str_replace("

", "", $description); // $description = str_replace("

", "
", $description); // $description = str_replace(",", ",", $description); - $description = htmlspecialchars_decode($description,ENT_QUOTES,"UTF-8"); + $description = htmlspecialchars_decode($description,ENT_QUOTES); $input = $_POST['input']; // $input = str_replace("

", "", $input); // $input = str_replace("

", "
", $input); // $input = str_replace(",", ",", $input); - $input = htmlspecialchars_decode($input,ENT_QUOTES,"UTF-8"); + $input = htmlspecialchars_decode($input,ENT_QUOTES); $output = $_POST['output']; // $output = str_replace("

", "", $output); // $output = str_replace("

", "
", $output); // $output = str_replace(",", ",", $output); - $output = htmlspecialchars_decode($output,ENT_QUOTES,"UTF-8"); + $output = htmlspecialchars_decode($output,ENT_QUOTES); $sample_input = $_POST['sample_input']; $sample_output = $_POST['sample_output']; @@ -260,7 +261,7 @@ include_once("kindeditor.php") ; // $hint = str_replace("

", "", $hint); // $hint = str_replace("

", "
", $hint); // $hint = str_replace(",", ",", $hint); - $hint = htmlspecialchars_decode($hint,ENT_QUOTES,"UTF-8"); + $hint = htmlspecialchars_decode($hint,ENT_QUOTES); $source = $_POST['source']; $remote_oj= $_POST['remote_oj']; diff --git a/web/admin/problem_export_xml.php b/web/admin/problem_export_xml.php index bb6009b..28a314d 100644 --- a/web/admin/problem_export_xml.php +++ b/web/admin/problem_export_xml.php @@ -124,7 +124,7 @@ function getSolution($pid,$lang) { function fixurl($img_url) { if(substr($img_url,0,4)=="data") return $img_url; - $img_url = htmlspecialchars_decode($img_url,ENT_QUOTES,"UTF-8"); + $img_url = htmlspecialchars_decode($img_url,ENT_QUOTES); if (substr($img_url,0,4)!="http") { if (substr($img_url,0,1)=="/") { diff --git a/web/bsadmin/problem_export_xml.php b/web/bsadmin/problem_export_xml.php index b09d0e0..207866e 100644 --- a/web/bsadmin/problem_export_xml.php +++ b/web/bsadmin/problem_export_xml.php @@ -106,7 +106,7 @@ function getSolution($pid,$lang){ return $ret; } function fixurl($img_url){ - $img_url= htmlspecialchars_decode( $img_url,ENT_QUOTES,"UTF-8"); + $img_url= htmlspecialchars_decode( $img_url,ENT_QUOTES); if (substr($img_url,0,4)!="http"){ if(substr($img_url,0,1)=="/"){ diff --git a/web/include/PHPMailer.php b/web/include/PHPMailer.php index 1bcf5c8..13676d0 100644 --- a/web/include/PHPMailer.php +++ b/web/include/PHPMailer.php @@ -4514,8 +4514,7 @@ class PHPMailer return htmlspecialchars_decode( trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), - ENT_QUOTES, - $this->CharSet + ENT_QUOTES ); } diff --git a/web/swadmin/problem_export_xml.php b/web/swadmin/problem_export_xml.php index b09d0e0..207866e 100644 --- a/web/swadmin/problem_export_xml.php +++ b/web/swadmin/problem_export_xml.php @@ -106,7 +106,7 @@ function getSolution($pid,$lang){ return $ret; } function fixurl($img_url){ - $img_url= htmlspecialchars_decode( $img_url,ENT_QUOTES,"UTF-8"); + $img_url= htmlspecialchars_decode( $img_url,ENT_QUOTES); if (substr($img_url,0,4)!="http"){ if(substr($img_url,0,1)=="/"){