From ade450f76598273e1b10f14f8650fc2c8e2e0843 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 23 Dec 2009 15:22:48 +1300 Subject: [PATCH] Correct logic when processing directory of files. --- htdocs/tools.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/tools.php b/htdocs/tools.php index a1e4eda8..9fda9d01 100644 --- a/htdocs/tools.php +++ b/htdocs/tools.php @@ -112,10 +112,8 @@ class Tools { } if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { - if ($file != "." && $file != ".." && substr($file,-4) != '.ics') { - continue; - } - if(!is_readable($dir.'/'.$file)){ + if ($file == "." || $file == ".." || substr($file,-4) != '.ics') continue; + if ( !is_readable($dir.'/'.$file) ) { dbg_error_log( "importFromDirectory", "ics file '%s' is not readable",$dir .'/'.$file); continue; }