diff options
author | Martin <martin.mattel@diemattels.at> | 2015-09-21 14:09:28 +0200 |
---|---|---|
committer | root <martin.mattel@diemattels.at> | 2015-09-22 17:53:15 +0200 |
commit | 491250320a6b19f9a7d546598e97eac1e90f78f7 (patch) | |
tree | 1021d069627a22699713f5c75eba17dac97f734c /lib/private/files/storage | |
parent | 7222e5fb4d8e165733fac4ac9c85e471c0d34fb7 (diff) | |
download | nextcloud-server-491250320a6b19f9a7d546598e97eac1e90f78f7.tar.gz nextcloud-server-491250320a6b19f9a7d546598e97eac1e90f78f7.zip |
Replaces if ($file === '.' || $file === '..') by if(\OC\Files\Filesystem::isIgnoredDir($file)). Eases to find where this operation is used.
Diffstat (limited to 'lib/private/files/storage')
-rw-r--r-- | lib/private/files/storage/common.php | 4 | ||||
-rw-r--r-- | lib/private/files/storage/local.php | 2 | ||||
-rw-r--r-- | lib/private/files/storage/polyfill/copydirectory.php | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index a5ed5fd3996..2d579fa2b60 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -260,7 +260,7 @@ abstract class Common implements Storage { $dh = $this->opendir($path); if (is_resource($dh)) { while (($file = readdir($dh)) !== false) { - if ($file !== '.' and $file !== '..') { + if (!\OC\Files\Filesystem::isIgnoredDir($file)) { if ($this->is_dir($path . '/' . $file)) { mkdir($target . '/' . $file); $this->addLocalFolder($path . '/' . $file, $target . '/' . $file); @@ -283,7 +283,7 @@ abstract class Common implements Storage { $dh = $this->opendir($dir); if (is_resource($dh)) { while (($item = readdir($dh)) !== false) { - if ($item == '.' || $item == '..') continue; + if (\OC\Files\Filesystem::isIgnoredDir($item)) continue; if (strstr(strtolower($item), strtolower($query)) !== false) { $files[] = $dir . '/' . $item; } diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php index 3676fe69131..4b6b08a16fd 100644 --- a/lib/private/files/storage/local.php +++ b/lib/private/files/storage/local.php @@ -283,7 +283,7 @@ class Local extends \OC\Files\Storage\Common { $files = array(); $physicalDir = $this->getSourcePath($dir); foreach (scandir($physicalDir) as $item) { - if ($item == '.' || $item == '..') + if (\OC\Files\Filesystem::isIgnoredDir($item)) continue; $physicalItem = $physicalDir . '/' . $item; diff --git a/lib/private/files/storage/polyfill/copydirectory.php b/lib/private/files/storage/polyfill/copydirectory.php index 1b4873a3a76..73c6d3d5436 100644 --- a/lib/private/files/storage/polyfill/copydirectory.php +++ b/lib/private/files/storage/polyfill/copydirectory.php @@ -72,7 +72,7 @@ trait CopyDirectory { $dh = $this->opendir($source); $result = true; while ($file = readdir($dh)) { - if ($file !== '.' and $file !== '..') { + if (!\OC\Files\Filesystem::isIgnoredDir($file)) { if ($this->is_dir($source . '/' . $file)) { $this->mkdir($target . '/' . $file); $result = $this->copyRecursive($source . '/' . $file, $target . '/' . $file); |