Remove some obsoleted parsing functions.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 22 May 2003 16:22:52 +0000 (16:22 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 22 May 2003 16:22:52 +0000 (16:22 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4891 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php
functions/strings.php

index 5df9ad31f1b7ffa45e887bea20c34aea51ea99dd..369a00edb087436383070aee2b28e4c4e77bd3e9 100755 (executable)
@@ -11,6 +11,8 @@
  * $Id$
  */
 
+/* NOTE: quite some functions in this file are not used anymore. */
+
 /* Copies specified messages to specified folder */
 /* obsolete */
 function sqimap_messages_copy ($imap_stream, $start, $end, $mailbox) {
@@ -66,6 +68,7 @@ function sqimap_toggle_flag($imap_stream, $id, $flag, $set, $handle_errors) {
     $read = sqimap_run_command ($imap_stream, "STORE $msgs_id ".$set_string."FLAGS ($flag)", $handle_errors, $response, $message, $uid_support);
 }
 
+// obsolete?
 function sqimap_get_small_header ($imap_stream, $id, $sent) {
     $res = sqimap_get_small_header_list($imap_stream, $id, $sent);
     return $res[0];
@@ -407,6 +410,7 @@ function elapsedTime($start) {
  return $timepassed;
 }
 
+// only used in sqimap_get_small_header_list
 function parseString($read,&$i) {
     $char = $read{$i};
     $s = '';
@@ -449,19 +453,7 @@ function parseString($read,&$i) {
     return $s;
 }
 
-function parseInteger($read,&$i) {
-    $s = false;
-    $i_pos = strpos($read,' ',$i);
-    if (!$i_pos) {
-        $i_pos = strpos($read,')',$i);
-    }
-    if ($i_pos) {
-        $s = substr($read,$i,$i_pos-$i);
-        $i = $i_pos+1;
-    }
-    return $s;
-}
-
+// only used in sqimap_get_small_header_list
 function parseArray($read,&$i) {
     $i = strpos($read,'(',$i);
     $i_pos = strpos($read,')',$i);
@@ -702,6 +694,7 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list, $show_num=false)
     return $new_messages;
 }
 
+// obsolete?
 function sqimap_get_headerfield($imap_stream, $field) {
     global $uid_support;
     $sid = sqimap_session_id(false);
@@ -785,6 +778,7 @@ function sqimap_get_message ($imap_stream, $id, $mailbox) {
 }
 
 /* Wrapper function that reformats the header information. */
+// obsolete?
 function sqimap_get_message_header ($imap_stream, $id, $mailbox) {
     global $uid_support;
     $read = sqimap_run_command ($imap_stream, "FETCH $id BODY[HEADER]", true, $response, $message, $uid_support);
@@ -795,6 +789,7 @@ function sqimap_get_message_header ($imap_stream, $id, $mailbox) {
 }
 
 /* Wrapper function that reformats the entity header information. */
+// obsolete?
 function sqimap_get_ent_header ($imap_stream, $id, $mailbox, $ent) {
     global $uid_support;
     $read = sqimap_run_command ($imap_stream, "FETCH $id BODY[$ent.HEADER]", true, $response, $message, $uid_support);
@@ -805,6 +800,7 @@ function sqimap_get_ent_header ($imap_stream, $id, $mailbox, $ent) {
 }
 
 /* function to get the mime headers */
+// obsolete?
 function sqimap_get_mime_ent_header ($imap_stream, $id, $mailbox, $ent) {
     global $uid_support;
     $read = sqimap_run_command ($imap_stream, "FETCH $id:$id BODY[$ent.MIME]", true, $response, $message, $uid_support);
index 8f278b12c115aa25c94a5282f61ba241281c1798..db5ff7c2e61b480d0f9d4e81e6de945d887d1b7d 100644 (file)
@@ -151,42 +151,6 @@ function readShortMailboxName($haystack, $needle) {
     return( $elem );
 }
 
-/**
- * Returns an array of email addresses.
- * Be cautious of "user@host.com"
- */
-function parseAddrs($text) {
-    if (trim($text) == '')
-        return array();
-    $text = str_replace(' ', '', $text);
-    $text = ereg_replace('"[^"]*"', '', $text);
-    $text = ereg_replace('\\([^\\)]*\\)', '', $text);
-    $text = str_replace(',', ';', $text);
-    $array = explode(';', $text);
-    for ($i = 0; $i < count ($array); $i++) {
-        $array[$i] = eregi_replace ('^.*[<]', '', $array[$i]);
-        $array[$i] = eregi_replace ('[>].*$', '', $array[$i]);
-    }
-    return $array;
-}
-
-/**
- * Returns a line of comma separated email addresses from an array.
- */
-function getLineOfAddrs($array) {
-    if (is_array($array)) {
-        $to_line = implode(', ', $array);
-        $to_line = ereg_replace(', (, )+', ', ', $to_line);
-        $to_line = trim(ereg_replace('^, ', '', $to_line));
-        if( substr( $to_line, -1 ) == ',' )
-            $to_line = substr( $to_line, 0, -1 );
-    } else {
-        $to_line = '';
-    }
-    
-    return( $to_line );
-}
-
 function php_self () {
     if ( sqgetGlobalVar('REQUEST_URI', $req_uri, SQ_SERVER) && !empty($req_uri) ) {
       return $req_uri;
@@ -451,26 +415,6 @@ function TrimArray(&$array) {
     }
 }   
 
-/**
- * Removes slashes from every element in the array
- */
-function RemoveSlashes(&$array) {
-    foreach ($array as $k => $v) {
-        global $$k;
-        if (is_array($$k)) {
-            foreach ($$k as $k2 => $v2) {
-                $newArray[stripslashes($k2)] = stripslashes($v2);
-            }
-            $$k = $newArray;
-        } else {
-            $$k = stripslashes($v);
-        }
-        
-        /* Re-assign back to the array. */
-        $array[$k] = $$k;
-    }
-}
-
 $PHP_SELF = php_self();
 
 ?>