From: Michael M Slusarz Date: Thu, 25 Mar 2010 18:03:16 +0000 (-0600) Subject: This is a good place to use glob() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f2bc8cb3fe95c145ea2cbbd9f86c9de3164b58c9;p=horde.git This is a good place to use glob() --- 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;