Browse Source

Make listcommands work with php 4.0.4 and 4.0.5. Thanks Oyku Gencay.

Thijs Kinkhorst 22 years ago
parent
commit
de57b6365e
2 changed files with 4 additions and 7 deletions
  1. 2 1
      ChangeLog
  2. 2 6
      plugins/listcommands/setup.php

+ 2 - 1
ChangeLog

@@ -26,7 +26,8 @@ Version 1.4.0 CVS
   - Fixed encoding of email addresses in our composed messages.
   - Fixed folder creation for Courier using Autoconfig options.
   - Fixed encoded string handling inside MDN notifications
-  - Fixed unfold header routine in imap_messages (for mailbox_display)
+  - Fixed unfold header routine in imap_messages (for mailbox_display).
+  - Make listcommands work with PHP versions 4.0.4 & 4.0.5.
   
 Version 1.4.0 RC 2a
 -------------------

+ 2 - 6
plugins/listcommands/setup.php

@@ -40,12 +40,8 @@ function plugin_listcommands_menu() {
     foreach ($message->rfc822_header->mlist as $cmd => $actions) {
 
 	/* I don't know this action... skip it */
-        /* grrr PHP keeps changing their syntax... */
-        if( function_exists('array_key_exists') ) {
-            if(!array_key_exists($cmd, $fieldsdescr)) {
-                continue;
-            }
-        } elseif ( !key_exists($cmd, $fieldsdescr) ) {
+        /* array_key_exists works only in >= 4.1 */
+        if ( !in_array($cmd, array_keys($fieldsdescr)) ) {
             continue;
         }