From 73ed4ae8513af1cc6e795b125cc1f319a965bfb4 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 12 Mar 2010 17:03:51 +0000 Subject: Merged Cash's bugfixes from the 1.7 branch (3288:5377). git-svn-id: http://code.elgg.org/elgg/trunk@5378 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/diagnostics/start.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'mod/diagnostics') diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php index c114c054e..12795ebc8 100644 --- a/mod/diagnostics/start.php +++ b/mod/diagnostics/start.php @@ -91,22 +91,22 @@ function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params) */ function diagnostics_md5_dir($dir) { - //if (is_file(trim($dir, "/"))) { - $extensions_allowed = array('.php', '.gif', '.png', '.jpg'); + $extensions_allowed = array('.php', '.js', '.css'); $buffer = ""; - if (in_array(strrchr(trim($dir, "/"), '.'), $extensions_allowed)) - { - //$dir = trim($dir, "/"); - $buffer .= md5_file($dir). " " . trim($dir, "/") . "\n"; - } else if ($handle = opendir($dir)) { + if (in_array(strrchr(trim($dir, "/"), '.'), $extensions_allowed)) { + $dir = rtrim($dir, "/"); + $buffer .= md5_file($dir). " " . $dir . "\n"; + } else if (is_dir($dir)) { + $handle = opendir($dir); while ($file = readdir($handle)) { - if (($file != '.') && ($file != '..')) { $buffer .= diagnostics_md5_dir($dir . $file. "/", $buffer); } } + + closedir($handle); } return $buffer; -- cgit v1.2.3