--- index.php	2011-11-07 14:38:33.000000000 +0100
+++ /home/jjl/wikiss/index.php	2011-12-05 14:35:36.305576000 +0100
@@ -9,7 +9,7 @@
    $perf1 = microtime();
    */
    
-   $WIKI_VERSION = 'WiKiss 0.4beta1';
+   $WIKI_VERSION = 'WiKiss 0.4beta2';
    
    ini_set('default_charset','UTF-8'); // Default character set for auto content type header
    header('Content-type: text/html; charset=UTF-8');
@@ -97,17 +97,18 @@
    $editable = TRUE; // la page est editable
 
    /** Chargement des plugins */
-   if (is_dir($plugins_dir) && ($dir = opendir($plugins_dir)))
+   if (is_dir($plugins_dir))
    {
-      while (($file = readdir($dir)) !== false)
+//       while (($file = readdir($dir)) !== false)
+      // load plugins in alpha order
+      foreach ( scandir($plugins_dir) as $file)
       {
          if (preg_match('/^wkp_(.+)\.php$/', $file, $matches)>0)
          {
             require $plugins_dir . $file;
-            $plugins[] = new $matches[1]();
+            array_push ($plugins, new $matches[1]());
          }
       }
-      //~ print_r($plugins);
    }
 
    // Load current language
