From 9a2ff10616aa664120a3f2d56741cd6721c76801 Mon Sep 17 00:00:00 2001 From: xfnw Date: Thu, 24 Jun 2021 14:00:33 -0400 Subject: [PATCH] fix the double-escaping of htmlspecialchars --- index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index f213522..a0902bc 100644 --- a/index.php +++ b/index.php @@ -67,18 +67,18 @@ if (isset($_GET['q']) && preg_replace('/\s+/', '', $_GET['q']) != '') { ?>
- +
-(score: ) +(score: )
...'.htmlspecialchars($param).''; - echo htmlspecialchars(substr($content,$pos+strlen($param),50)).'...'; + echo htmlspecialchars(htmlspecialchars_decode(substr($content,$pos-50,50))); + echo ''.htmlspecialchars(htmlspecialchars_decode($param)).''; + echo htmlspecialchars(htmlspecialchars_decode(substr($content,$pos+strlen($param),50))).'...'; } }