Validate is_dir on the given directory
authorTim Düsterhus <timwolla@arcor.de>
Sat, 16 Jul 2011 14:35:37 +0000 (16:35 +0200)
committerTim Düsterhus <timwolla@arcor.de>
Sat, 16 Jul 2011 14:35:37 +0000 (16:35 +0200)
wcfsetup/install/files/lib/util/DirectoryUtil.class.php

index f0989b67bd1ef3160cb51923e27adeb5c396c534..511d23d49ef4a418404afba73a6f441841f2f7d4 100644 (file)
@@ -125,6 +125,9 @@ class DirectoryUtil {
                if ($directory === false) {
                        throw new SystemException("Unknown directory '".$tmpDirectory."'");
                }
+               if (!is_dir($directory)) {
+                       throw new SystemException("'".$tmpDirectory."' is no directory");
+               }
                
                if (!isset(static::$instances[$recursive][$directory])) {
                        static::$instances[$recursive][$directory] = new static($directory, $recursive);