From d40cdeb65e0ed0cae4d675dca7ece64b188c46ae Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Wed, 28 Nov 2012 17:04:01 +0000 Subject: [PATCH] Syntax tidy up Removed commented code, simplify parens & tabbed formatting --- files.php | 25 +++++++++++-------------- lib/config.php | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) 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