Explorar el Código

Show search query in the page title (#8217)

* Show search query in the page title

* Simplify encoding

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Inverle hace 4 meses
padre
commit
f5d14af156
Se han modificado 2 ficheros con 5 adiciones y 1 borrados
  1. 4 0
      app/Controllers/indexController.php
  2. 1 1
      app/layout/header.phtml

+ 4 - 0
app/Controllers/indexController.php

@@ -104,6 +104,10 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController {
 
 		$this->view->rss_title = FreshRSS_Context::$name . ' | ' . FreshRSS_View::title();
 		$title = FreshRSS_Context::$name;
+		$search = Minz_Request::paramString('search');
+		if ($search !== '') {
+			$title = '“' . $search . '”';
+		}
 		if (FreshRSS_Context::$get_unread > 0) {
 			$title = '(' . FreshRSS_Context::$get_unread . ') ' . $title;
 		}

+ 1 - 1
app/layout/header.phtml

@@ -40,7 +40,7 @@
 			<?php } ?>
 			<div class="stick">
 				<input type="search" name="search" id="search"
-					value="<?= htmlspecialchars(htmlspecialchars_decode(Minz_Request::paramString('search'), ENT_QUOTES), ENT_COMPAT, 'UTF-8') ?>"
+					value="<?= Minz_Request::paramString('search') ?>"
 					placeholder="<?= _t('gen.menu.search') ?>" />
 				<button class="btn" type="submit"><?= _i('search') ?></button>
 			</div>