Pārlūkot izejas kodu

SizeOf is now StrLen where appropriate

Andy 7 gadi atpakaļ
vecāks
revīzija
d5dd5a28c2
3 mainītis faili ar 9 papildinājumiem un 4 dzēšanām
  1. 1 1
      functions/imap_general.php
  2. 7 2
      functions/imap_messages.php
  3. 1 1
      functions/mime.php

+ 1 - 1
functions/imap_general.php

@@ -1213,7 +1213,7 @@ function sqimap_parse_namespace(&$input) {
                 $namespace[$ns_strings[$i]] = array();
                 $namespace[$ns_strings[$i]] = array();
             } else {
             } else {
                 // Pop-out the first ( and last ) for easier parsing
                 // Pop-out the first ( and last ) for easier parsing
-                $ns = substr($regs[$i], 1, sizeof($regs[$i])-2);
+                $ns = substr($regs[$i], 1, strlen($regs[$i])-2);
                 if($c = preg_match_all('/\((?:(.*?)\s*?)\)/', $ns, $regs2)) {
                 if($c = preg_match_all('/\((?:(.*?)\s*?)\)/', $ns, $regs2)) {
                     $namespace[$ns_strings[$i]] = array();
                     $namespace[$ns_strings[$i]] = array();
                     for($j=0; $j<sizeof($regs2[1]); $j++) {
                     for($j=0; $j<sizeof($regs2[1]); $j++) {

+ 7 - 2
functions/imap_messages.php

@@ -89,12 +89,17 @@ function sqimap_msgs_list_delete($imap_stream, $mailbox, $id, $bypass_trash=fals
  * @return array  $aMessageList array with messages containing the new flags and UID @see parseFetch
  * @return array  $aMessageList array with messages containing the new flags and UID @see parseFetch
  */
  */
 function sqimap_toggle_flag($imap_stream, $id, $flag, $set, $handle_errors) {
 function sqimap_toggle_flag($imap_stream, $id, $flag, $set, $handle_errors) {
+    $aMessageList = array();
     $msgs_id = sqimap_message_list_squisher($id);
     $msgs_id = sqimap_message_list_squisher($id);
     $set_string = ($set ? '+' : '-');
     $set_string = ($set ? '+' : '-');
 
 
-    for ($i=0; $i<sizeof($id); $i++) {
-        $aMessageList["$id[$i]"] = array();
+    if (is_array($id)) {
+     for ($i=0; $i<sizeof($id); $i++) {
+         $aMessageList["$id[$i]"] = array();
+     }
     }
     }
+    else
+     $aMessageList[$id] = array();
 
 
     $aResponse = sqimap_run_command_list($imap_stream, "STORE $msgs_id ".$set_string."FLAGS ($flag)", $handle_errors, $response, $message, TRUE);
     $aResponse = sqimap_run_command_list($imap_stream, "STORE $msgs_id ".$set_string."FLAGS ($flag)", $handle_errors, $response, $message, TRUE);
 
 

+ 1 - 1
functions/mime.php

@@ -1386,7 +1386,7 @@ function sq_casenormalize(&$val){
 function sq_skipspace($body, $offset){
 function sq_skipspace($body, $offset){
     $me = 'sq_skipspace';
     $me = 'sq_skipspace';
     preg_match('/^(\s*)/s', substr($body, $offset), $matches);
     preg_match('/^(\s*)/s', substr($body, $offset), $matches);
-    if (sizeof($matches{1})){
+    if (strlen($matches{1}) > 0){
         $count = strlen($matches{1});
         $count = strlen($matches{1});
         $offset += $count;
         $offset += $count;
     }
     }