Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-13 03:00:43 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-13 03:00:43 +0400
commit86eab2ee6c272e36a0757b38eeb192f9fd1d1f98 (patch)
tree6eba670f4f9d74826463703bdaab696d19bcbb83 /lib/helper.php
parent38258fe24686ca6cf8aa89d98521b848d22b6422 (diff)
some is_resource tests have been missing in #4701
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php20
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