From f2bc8cb3fe95c145ea2cbbd9f86c9de3164b58c9 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 25 Mar 2010 12:03:16 -0600 Subject: [PATCH] This is a good place to use glob() --- framework/Editor/lib/Horde/Editor.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/framework/Editor/lib/Horde/Editor.php b/framework/Editor/lib/Horde/Editor.php index 0c6832b35..e6bf2ae37 100644 --- a/framework/Editor/lib/Horde/Editor.php +++ b/framework/Editor/lib/Horde/Editor.php @@ -110,18 +110,15 @@ class Horde_Editor /** * List the available editors. - * Can be called statically: Horde_Editor::availableEditors(); * * @return array List of available editors. */ static public function availableEditors() { $eds = array(); - $d = dir(dirname(__FILE__) . '/Editor'); - while (false !== ($entry = $d->read())) { - if (preg_match('/\.php$/', $entry)) { - $eds[] = basename($entry, '.php'); - } + + foreach (glob(dirname(__FILE__) . '/Editor/*.php') as $val) { + $eds[] = basename($val, '.php'); } return $eds; -- 2.11.0