From 18320d59a448396eba87aee034ac545eb8f16bcc Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 2 Mar 2008 04:07:17 +0000 Subject: [PATCH] Fix some backwards compatibility issues in FSTools::globr. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1588 48356398-32a2-884e-a903-53898d9a118a --- extras/FSTools.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extras/FSTools.php b/extras/FSTools.php index 3cc6023a..7b5e7619 100644 --- a/extras/FSTools.php +++ b/extras/FSTools.php @@ -133,7 +133,10 @@ class FSTools */ public function globr($dir, $pattern, $flags = NULL) { $files = $this->glob("$dir/$pattern", $flags); - foreach ($this->glob("$dir/*", GLOB_ONLYDIR) as $sub_dir) { + if ($files === false) $files = array(); + $sub_dirs = $this->glob("$dir/*", GLOB_ONLYDIR); + if ($sub_dirs === false) $sub_dirs = array(); + foreach ($sub_dirs as $sub_dir) { $sub_files = $this->globr($sub_dir, $pattern, $flags); $files = array_merge($files, $sub_files); }