Fixed issue with types

This commit is contained in:
Jose Gonzalez 2021-06-02 16:06:00 +02:00
parent 897a98eab6
commit 7895a82268
1 changed files with 2 additions and 2 deletions

View File

@ -981,12 +981,12 @@ function filemanager_safe_directory(
$directory = io_safe_output($directory);
$forbiddenAttempting = false;
if (preg_match('/(\.){1,2}/', $directory) !== false) {
if ((bool) preg_match('/(\.){1,2}/', $directory) !== false) {
$directory = preg_replace('/(\.){1,2}/', '', (empty($safedDirectory) === true) ? $directory : $safedDirectory);
$forbiddenAttempting = true;
}
if (preg_match('/(/\/\)+/', $directory) !== false) {
if ((bool) preg_match('/(/\/\)+/', $directory) !== false) {
$directory = preg_replace('/(/\/\)+/', '/', (empty($safedDirectory) === true) ? $directory : $safedDirectory);
$forbiddenAttempting = true;
}