A free, self-hostable news aggregator…
Fix htmlspecialchars for search (#8306)
Alexandre Alapetite044f066c1c9f
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.phpindex d914e4eef..3961a3fcd 100644--- a/app/Controllers/indexController.php+++ b/app/Controllers/indexController.php@@ -106,7 +106,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController {$title = FreshRSS_Context::$name;$search = FreshRSS_Context::$search->__toString();if ($search !== '') {- $title = '“' . $search . '”';+ $title = '“' . htmlspecialchars($search, ENT_COMPAT, 'UTF-8') . '”';}if (FreshRSS_Context::$get_unread > 0) {$title = '(' . FreshRSS_Context::$get_unread . ') ' . $title;diff --git a/app/layout/header.phtml b/app/layout/header.phtmlindex 5c6ea63a4..73dfb3119 100644--- a/app/layout/header.phtml+++ b/app/layout/header.phtml@@ -40,7 +40,7 @@<?php } ?><div class="stick"><input type="search" name="search" id="search"- value="<?= FreshRSS_Context::$search->__toString() ?>"+ value="<?= htmlspecialchars(FreshRSS_Context::$search->__toString(), ENT_COMPAT, 'UTF-8') ?>"placeholder="<?= _t('gen.menu.search') ?>" /><button class="btn" type="submit"><?= _i('search') ?></button></div>