diff --git a/files.php b/files.php index 194ed32..11bcf7f 100644 --- a/files.php +++ b/files.php @@ -32,21 +32,18 @@ class SortingIterator implements IteratorAggregate { } class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator { - function getChildren() { - try { -// echo "
".var_export( $this->key(), true ).""; -// echo "
".var_export( $this->getSubPath(), true ).""; -// echo "
".var_export( $this->getSubPathname(), true ).""; - if ( (!isset($GLOBALS['ICEcoder']['bannedPaths'])) || - (! (in_array( $this->key(), $GLOBALS['ICEcoder']['bannedPaths'] ))) ) { - return parent::getChildren(); - } else { - return new RecursiveArrayIterator(array()); + function getChildren() { + try { + if (!isset($GLOBALS['ICEcoder']['bannedPaths']) || + !in_array($this->key(), $GLOBALS['ICEcoder']['bannedPaths'])) { + return parent::getChildren(); + } else { + return new RecursiveArrayIterator(array()); + } + } catch(UnexpectedValueException $e) { + return new RecursiveArrayIterator(array()); + } } - } catch(UnexpectedValueException $e) { - return new RecursiveArrayIterator(array()); - } - } } // Get a full list of dirs & files and begin sorting using above class & function diff --git a/lib/config.php b/lib/config.php index b506829..87a01d3 100644 --- a/lib/config.php +++ b/lib/config.php @@ -24,4 +24,4 @@ $ICEcoder = array( "previousFiles" => "", "last10Files" => "" ); -?> +?> \ No newline at end of file