summaryrefslogtreecommitdiffstats
path: root/lib/cache/fileglobal.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-08-19 12:04:53 +0200
committerRobin Appelman <icewind@owncloud.com>2013-08-19 12:04:53 +0200
commitc5402f457530577999d1adc1715c76e742ad8aa9 (patch)
tree85b40240d914a51513940c14179fdecdcb78ad4c /lib/cache/fileglobal.php
parenta1d5aba5fd3795a6ee4a87c96abf0d35d3f8116d (diff)
downloadnextcloud-server-c5402f457530577999d1adc1715c76e742ad8aa9.tar.gz
nextcloud-server-c5402f457530577999d1adc1715c76e742ad8aa9.zip
use strict equals in readdir loops to prevent issues with '0' files
Diffstat (limited to 'lib/cache/fileglobal.php')
-rw-r--r--lib/cache/fileglobal.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cache/fileglobal.php b/lib/cache/fileglobal.php
index 6d01964e185..2fbd8ca3edb 100644
--- a/lib/cache/fileglobal.php
+++ b/lib/cache/fileglobal.php
@@ -69,7 +69,7 @@ class OC_Cache_FileGlobal{
$prefix = $this->fixKey($prefix);
if($cache_dir and is_dir($cache_dir)) {
$dh=opendir($cache_dir);
- while($file=readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if($file!='.' and $file!='..' and ($prefix==='' || strpos($file, $prefix) === 0)) {
unlink($cache_dir.$file);
}
@@ -88,7 +88,7 @@ class OC_Cache_FileGlobal{
$cache_dir = self::getCacheDir();
if($cache_dir and is_dir($cache_dir)) {
$dh=opendir($cache_dir);
- while($file=readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if($file!='.' and $file!='..') {
$mtime = filemtime($cache_dir.$file);
if ($mtime < $now) {