浏览代码

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

Thijs Kinkhorst 22 年之前
父节点
当前提交
de57b6365e
共有 2 个文件被更改,包括 4 次插入7 次删除
  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 encoding of email addresses in our composed messages.
   - Fixed folder creation for Courier using Autoconfig options.
   - Fixed folder creation for Courier using Autoconfig options.
   - Fixed encoded string handling inside MDN notifications
   - 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
 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) {
     foreach ($message->rfc822_header->mlist as $cmd => $actions) {
 
 
 	/* I don't know this action... skip it */
 	/* 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;
             continue;
         }
         }