Define $folder before using it

This commit is contained in:
Pontus Horn
2019-11-11 17:39:54 +01:00
committed by GitHub
parent 76e9bab587
commit 4476f85886

View File

@@ -55,6 +55,7 @@ class PicoSearch extends AbstractPicoPlugin
{
if ($this->search_terms) {
$pico = $this->getPico();
$folder = '';
// Aggressively strip out any ./ or ../ parts from the search area before using it
// as the folder to look in. Should already be taken care of previously, but just
@@ -64,7 +65,7 @@ class PicoSearch extends AbstractPicoPlugin
$folder = preg_replace('~\.+/~', '', $folder);
}
$temp_file = $pico->getConfig('content_dir') . ($folder ?: '') . 'search' . $pico->getConfig('content_ext');
$temp_file = $pico->getConfig('content_dir') . $folder . 'search' . $pico->getConfig('content_ext');
if (file_exists($temp_file)) {
$file = $temp_file;
}