From 037e4b83865533182d8177b75ff234138e8f9c98 Mon Sep 17 00:00:00 2001 From: Pontus Horn af Rantzien Date: Mon, 17 Oct 2016 13:00:01 +0200 Subject: [PATCH] Improve effectiveness of regular expressions --- 40-PicoSearch.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/40-PicoSearch.php b/40-PicoSearch.php index 4808b46..4115b10 100644 --- a/40-PicoSearch.php +++ b/40-PicoSearch.php @@ -61,8 +61,7 @@ class PicoSearch extends AbstractPicoPlugin // as a safeguard to make sure nothing slips through the cracks. if ($this->search_area) { $folder = str_replace('\\', '/', $this->search_area); - $folder = preg_replace('~\.\./~', '', $folder); - $folder = preg_replace('~\./~', '', $folder); + $folder = preg_replace('~\.+/~', '', $folder); } $temp_file = $pico->getConfig('content_dir') . ($folder ?: '') . 'search' . $pico->getConfig('content_ext');