Browse Source

Required Param Not Allowed After Optional Param

PHP 8's finally being a stickler about these things.
Andy 4 years ago
parent
commit
9572d6c6ca
4 changed files with 20 additions and 16 deletions
  1. 5 3
      functions/imap_mailbox.php
  2. 1 1
      functions/mime.php
  3. 1 1
      plugins/newmail/functions.php
  4. 13 11
      plugins/spamcop/functions.php

+ 5 - 3
functions/imap_mailbox.php

@@ -1247,7 +1247,7 @@ function mbxSort($a, $b) {
  * @return object see mailboxes class
  * @return object see mailboxes class
  * @since 1.5.0
  * @since 1.5.0
  */
  */
-function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream) {
+function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream=null) {
     global $data_dir, $username, $list_special_folders_first,
     global $data_dir, $username, $list_special_folders_first,
            $folder_prefix, $trash_folder, $sent_folder, $draft_folder,
            $folder_prefix, $trash_folder, $sent_folder, $draft_folder,
            $move_to_trash, $move_to_sent, $save_as_draft,
            $move_to_trash, $move_to_sent, $save_as_draft,
@@ -1314,8 +1314,10 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream) {
             $mailboxes->addMbx($mbx, $delimiter, $start, $list_special_folders_first);
             $mailboxes->addMbx($mbx, $delimiter, $start, $list_special_folders_first);
         }
         }
     }
     }
-    sqimap_utf7_decode_mbx_tree($mailboxes);
-    sqimap_get_status_mbx_tree($imap_stream,$mailboxes);
+    if ($imap_stream !== null) {
+        sqimap_utf7_decode_mbx_tree($mailboxes);
+        sqimap_get_status_mbx_tree($imap_stream,$mailboxes);
+    }
     return $mailboxes;
     return $mailboxes;
 }
 }
 
 

+ 1 - 1
functions/mime.php

@@ -194,7 +194,7 @@ function mime_fetch_body($imap_stream, $id, $ent_id=1, $fetch_size=0) {
     return $ret;
     return $ret;
 }
 }
 
 
-function mime_print_body_lines ($imap_stream, $id, $ent_id=1, $encoding, $rStream='php://stdout', $force_crlf='') {
+function mime_print_body_lines ($imap_stream, $id, $ent_id=1, $encoding='', $rStream='php://stdout', $force_crlf='') {
 
 
     /* Don't kill the connection if the browser is over a dialup
     /* Don't kill the connection if the browser is over a dialup
      * and it would take over 30 seconds to download it.
      * and it would take over 30 seconds to download it.

+ 1 - 1
plugins/newmail/functions.php

@@ -507,7 +507,7 @@ function newmail_media_object($object,$type,$path,$args=array(),$addsuffix=true)
  * @return string object html tags and attributes required by selected media type.
  * @return string object html tags and attributes required by selected media type.
  * @todo add ogg and svg support
  * @todo add ogg and svg support
  */
  */
-function newmail_media_object_ie($object,$type,$path,$args=array(),$addsuffix) {
+function newmail_media_object_ie($object,$type,$path,$args=array(),$addsuffix=true) {
     $ret_ie='';
     $ret_ie='';
     $suffix='';
     $suffix='';
     $sArgs=newmail_media_prepare_args($args);
     $sArgs=newmail_media_prepare_args($args);

+ 13 - 11
plugins/spamcop/functions.php

@@ -179,20 +179,22 @@ function spamcop_enable_disable($option,$disable_action,$enable_action) {
  * @todo Duplicate code in src/compose.php
  * @todo Duplicate code in src/compose.php
  */
  */
 function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed_id,
 function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed_id,
-                                      $passed_ent_id='', $imapConnection) {
+                                      $passed_ent_id='', $imapConnection=null) {
                                           
                                           
     global $username, $attachment_dir;
     global $username, $attachment_dir;
 
 
-    if (!$passed_ent_id) {
-        $body_a = sqimap_run_command($imapConnection,
-                                    'FETCH '.$passed_id.' RFC822',
-                                    TRUE, $response, $readmessage,
-                                    TRUE);
-    } else {
-        $body_a = sqimap_run_command($imapConnection,
-                                     'FETCH '.$passed_id.' BODY['.$passed_ent_id.']',
-                                     TRUE, $response, $readmessage,TRUE);
-        $message = $message->parent;
+    if ($imapConnection) {
+        if (!$passed_ent_id) {
+            $body_a = sqimap_run_command($imapConnection,
+                                        'FETCH '.$passed_id.' RFC822',
+                                        TRUE, $response, $readmessage,
+                                        TRUE);
+        } else {
+            $body_a = sqimap_run_command($imapConnection,
+                                         'FETCH '.$passed_id.' BODY['.$passed_ent_id.']',
+                                         TRUE, $response, $readmessage,TRUE);
+            $message = $message->parent;
+        }
     }
     }
     if ($response == 'OK') {
     if ($response == 'OK') {
         array_shift($body_a);
         array_shift($body_a);