diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-13 03:00:43 +0400 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-13 03:00:43 +0400 |
commit | 86eab2ee6c272e36a0757b38eeb192f9fd1d1f98 (patch) | |
tree | 6eba670f4f9d74826463703bdaab696d19bcbb83 /lib/helper.php | |
parent | 38258fe24686ca6cf8aa89d98521b848d22b6422 (diff) |
some is_resource tests have been missing in #4701
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/helper.php b/lib/helper.php index a612b7493da..ddd6ce9a149 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -299,18 +299,20 @@ class OC_Helper { if (!is_dir($path)) return chmod($path, $filemode); $dh = opendir($path); - while (($file = readdir($dh)) !== false) { - if($file != '.' && $file != '..') { - $fullpath = $path.'/'.$file; - if(is_link($fullpath)) - return false; - elseif(!is_dir($fullpath) && !@chmod($fullpath, $filemode)) + if(is_resource($dh)) { + while (($file = readdir($dh)) !== false) { + if($file != '.' && $file != '..') { + $fullpath = $path.'/'.$file; + if(is_link($fullpath)) return false; - elseif(!self::chmodr($fullpath, $filemode)) - return false; + elseif(!is_dir($fullpath) && !@chmod($fullpath, $filemode)) + return false; + elseif(!self::chmodr($fullpath, $filemode)) + return false; + } } + closedir($dh); } - closedir($dh); if(@chmod($path, $filemode)) return true; else |