From 2aae664eb6a0ab1cebdfcd2b4bab9272dbb23400 Mon Sep 17 00:00:00 2001 From: muranava Date: Sun, 14 Mar 2021 14:35:08 +0100 Subject: [PATCH] add isset --- 40-PicoSearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40-PicoSearch.php b/40-PicoSearch.php index 01a5354..be457a3 100644 --- a/40-PicoSearch.php +++ b/40-PicoSearch.php @@ -28,7 +28,7 @@ class PicoSearch extends AbstractPicoPlugin public function onRequestUrl(&$url) { // If form was submitted without being intercepted by JavaScript, redirect to the canonical search URL. - if (preg_match('~^(.+/)?search$~', $url) && $_GET['q']) { + if (preg_match('~^(.+/)?search$~', $url) && isset($_GET['q'])) { header('Location: ' . $this->getPico()->getBaseUrl() . $url . '/' . urlencode($_GET['q'])); exit; }