Correct logic when processing directory of files.

This commit is contained in:
Andrew McMillan 2009-12-23 15:22:48 +13:00
parent 45790cfd48
commit ade450f765

View File

@ -112,10 +112,8 @@ class Tools {
} }
if ($handle = opendir($dir)) { if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) { while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && substr($file,-4) != '.ics') { if ($file == "." || $file == ".." || substr($file,-4) != '.ics') continue;
continue; if ( !is_readable($dir.'/'.$file) ) {
}
if(!is_readable($dir.'/'.$file)){
dbg_error_log( "importFromDirectory", "ics file '%s' is not readable",$dir .'/'.$file); dbg_error_log( "importFromDirectory", "ics file '%s' is not readable",$dir .'/'.$file);
continue; continue;
} }