Improve effectiveness of regular expressions

This commit is contained in:
Pontus Horn af Rantzien
2016-10-17 13:00:01 +02:00
committed by GitHub
parent 6fd9d6a4ca
commit 037e4b8386

View File

@@ -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');