From 7da7244a2ba2575ab88e34ae4398a1ea7f353606 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 2 Jul 2016 11:57:26 +0200 Subject: [PATCH] fix Scrutinizer "bugs" --- api/src/Etemplate/Widget/Vfs.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Vfs.php b/api/src/Etemplate/Widget/Vfs.php index 7882d6beba..3950fdef1f 100644 --- a/api/src/Etemplate/Widget/Vfs.php +++ b/api/src/Etemplate/Widget/Vfs.php @@ -254,7 +254,12 @@ class Vfs extends File { $path .= Api\Vfs::encodePathComponent($filename); } - if (!($dir = Api\Vfs::dirname($path)) || !Api\Vfs::file_exists($dir) && !Api\Vfs::mkdir($dir,null,STREAM_MKDIR_RECURSIVE)) + if (!($dir = Api\Vfs::dirname($path))) + { + self::set_validation_error($name,lang('Error create parent directory %1!', "dirname('$path') === false")); + return false; + } + if (!Api\Vfs::file_exists($dir) && !Api\Vfs::mkdir($dir,null,STREAM_MKDIR_RECURSIVE)) { self::set_validation_error($name,lang('Error create parent directory %1!',Api\Vfs::decodePath($dir))); return false;