Changeset 946

Show
Ignore:
Timestamp:
12/15/07 23:46:10 (10 months ago)
Author:
rats
Message:

* Update Squirrelmail to version 1.4.13 (#932)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r945 r946  
    66|                               * to fix: no errors on adding user (custom HP)    | 
    77\_________________________________________________________________/ 
     8 
     92007-23-15 Benedikt Heintel 
     10        - TOOLS: 
     11                * Update Squirrelmail to version 1.4.13 (#932) 
     12 
    813 
    9142007-12-13 Benedikt Heintel 
  • trunk/gui/tools/webmail/class/deliver/Deliver.class.php

    r821 r946  
    1010 * @copyright © 1999-2007 The SquirrelMail Project Team 
    1111 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    12  * @version $Id: Deliver.class.php 12565 2007-07-20 17:13:46Z kink
     12 * @version $Id: Deliver.class.php 12749 2007-10-31 03:38:19Z jangliss
    1313 * @package squirrelmail 
    1414 */ 
     
    3232     * function mail - send the message parts to the SMTP stream 
    3333     * 
    34      * @param Message  $message  Message class to send 
    35      * @param resource $stream   file handle to the SMTP stream 
     34     * @param Message  $message      Message object to send 
     35     * @param resource $stream       Handle to the SMTP stream 
     36     * @param string   $reply_id     Identifies message being replied to 
     37     *                               (OPTIONAL; caller should ONLY specify 
     38     *                               a value for this when the message 
     39     *                               being sent is a reply) 
     40     * @param string   $reply_ent_id Identifies message being replied to 
     41     *                               in the case it was an embedded/attached 
     42     *                               message inside another (OPTIONAL; caller 
     43     *                               should ONLY specify a value for this  
     44     *                               when the message being sent is a reply) 
    3645     * 
    3746     * @return integer $raw_length 
    3847     */ 
    39     function mail($message, $stream=false) { 
     48    function mail($message, $stream=false, $reply_id=0, $reply_ent_id=0) { 
    4049        $rfc822_header = $message->rfc822_header; 
    4150        if (count($message->entities)) { 
     
    4655        } 
    4756        $raw_length = 0; 
     57 
     58 
     59        // calculate reply header if needed 
     60        // 
     61        if ($reply_id) { 
     62            global $imapConnection, $username, $key, $imapServerAddress,  
     63                   $imapPort, $mailbox; 
     64            if (!$imapConnection) 
     65                $imapConnection = sqimap_login($username, $key,  
     66                                               $imapServerAddress, $imapPort, 0); 
     67 
     68            sqimap_mailbox_select($imapConnection, $mailbox); 
     69            $reply_message = sqimap_get_message($imapConnection, $reply_id, $mailbox); 
     70 
     71            if ($reply_ent_id) { 
     72                /* redefine the messsage in case of message/rfc822 */ 
     73                $reply_message = $message->getEntity($reply_ent_id); 
     74                /* message is an entity which contains the envelope and type0=message 
     75                 * and type1=rfc822. The actual entities are childs from 
     76                 * $reply_message->entities[0]. That's where the encoding and is located 
     77                 */ 
     78 
     79                $orig_header = $reply_message->rfc822_header; /* here is the envelope located */ 
     80 
     81            } else { 
     82                $orig_header = $reply_message->rfc822_header; 
     83            } 
     84            $message->reply_rfc822_header = $orig_header;             
     85        } 
     86 
     87 
    4888        $reply_rfc822_header = (isset($message->reply_rfc822_header) 
    4989                             ? $message->reply_rfc822_header : ''); 
  • trunk/gui/tools/webmail/class/deliver/Deliver_SMTP.class.php

    r821 r946  
    88 * @copyright © 1999-2007 The SquirrelMail Project Team 
    99 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    10  * @version $Id: Deliver_SMTP.class.php 12561 2007-07-20 16:53:53Z kink $ 
     10 * @version $Id: Deliver_SMTP.class.php 12778 2007-11-25 21:41:35Z pdontthink $ 
    1111 * @package squirrelmail 
    1212 */ 
     
    2929 
    3030    function initStream($message, $domain, $length=0, $host='', $port='', $user='', $pass='', $authpop=false) { 
    31         global $use_smtp_tls,$smtp_auth_mech,$username,$key,$onetimepad
     31        global $use_smtp_tls, $smtp_auth_mech
    3232 
    3333        if ($authpop) { 
    34             $this->authPop($host, '', $username, $pass); 
     34            $this->authPop($host, '', $user, $pass); 
    3535        } 
    3636 
     
    121121            // Depending on mechanism, generate response string 
    122122            if ($smtp_auth_mech == 'cram-md5') { 
    123                 $response = cram_md5_response($username,$pass,$chall); 
     123                $response = cram_md5_response($user,$pass,$chall); 
    124124            } elseif ($smtp_auth_mech == 'digest-md5') { 
    125                 $response = digest_md5_response($username,$pass,$chall,'smtp',$host); 
     125                $response = digest_md5_response($user,$pass,$chall,'smtp',$host); 
    126126            } 
    127127            fputs($stream, $response); 
     
    155155                return(0); 
    156156            } 
    157             fputs($stream, base64_encode ($username) . "\r\n"); 
     157            fputs($stream, base64_encode ($user) . "\r\n"); 
    158158            $tmp = fgets($stream, 1024); 
    159159            if ($this->errorCheck($tmp, $stream)) { 
     
    192192 
    193193        /* Ok, who is sending the message? */ 
    194         $fromaddress = ($from->mailbox && $from->host) ? 
     194        $fromaddress = (strlen($from->mailbox) && $from->host) ? 
    195195            $from->mailbox.'@'.$from->host : ''; 
    196196        fputs($stream, 'MAIL FROM:<'.$fromaddress.">\r\n"); 
     
    203203        for ($i = 0, $cnt = count($to); $i < $cnt; $i++) { 
    204204            if (!$to[$i]->host) $to[$i]->host = $domain; 
    205             if ($to[$i]->mailbox) { 
     205            if (strlen($to[$i]->mailbox)) { 
    206206                fputs($stream, 'RCPT TO:<'.$to[$i]->mailbox.'@'.$to[$i]->host.">\r\n"); 
    207207                $tmp = fgets($stream, 1024); 
     
    214214        for ($i = 0, $cnt = count($cc); $i < $cnt; $i++) { 
    215215            if (!$cc[$i]->host) $cc[$i]->host = $domain; 
    216             if ($cc[$i]->mailbox) { 
     216            if (strlen($cc[$i]->mailbox)) { 
    217217                fputs($stream, 'RCPT TO:<'.$cc[$i]->mailbox.'@'.$cc[$i]->host.">\r\n"); 
    218218                $tmp = fgets($stream, 1024); 
     
    225225        for ($i = 0, $cnt = count($bcc); $i < $cnt; $i++) { 
    226226            if (!$bcc[$i]->host) $bcc[$i]->host = $domain; 
    227             if ($bcc[$i]->mailbox) { 
     227            if (strlen($bcc[$i]->mailbox)) { 
    228228                fputs($stream, 'RCPT TO:<'.$bcc[$i]->mailbox.'@'.$bcc[$i]->host.">\r\n"); 
    229229                $tmp = fgets($stream, 1024); 
  • trunk/gui/tools/webmail/class/mime/Message.class.php

    r821 r946  
    88 * @copyright &copy; 2003-2007 The SquirrelMail Project Team 
    99 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    10  * @version $Id: Message.class.php 12542 2007-07-16 21:04:37Z kink $ 
     10 * @version $Id: Message.class.php 12757 2007-11-04 10:08:07Z kink $ 
    1111 * @package squirrelmail 
    1212 * @subpackage mime 
     
    3131     */ 
    3232    var $rfc822_header = ''; 
     33    /** 
     34     * Headers from original email in reply 
     35     * @var string  
     36     */ 
     37    var $reply_rfc822_header = ''; 
    3338    /** 
    3439     * MessageHeader object 
     
    821826     */ 
    822827    function parseParenthesis($read, $i) { 
    823         for (; $read{$i} != ')'; ++$i) { 
     828        for ($i++; $read{$i} != ')'; ++$i) { 
    824829            switch ($read{$i}) { 
    825830                case '"': $this->parseQuote($read, $i); break; 
  • trunk/gui/tools/webmail/class/mime/Rfc822Header.class.php

    r821 r946  
    88 * @copyright &copy; 2003-2007 The SquirrelMail Project Team 
    99 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    10  * @version $Id: Rfc822Header.class.php 12656 2007-08-31 23:20:21Z pdontthink
     10 * @version $Id: Rfc822Header.class.php 12764 2007-11-15 05:52:52Z jangliss
    1111 * @package squirrelmail 
    1212 * @subpackage mime 
     
    538538                    $aAddress[] = $this->createAddressObject($aStack,$aComment,$sEmail,$sGroup); 
    539539                    $oAddr = end($aAddress); 
    540                     if(!$oAddr || ((isset($oAddr)) && !$oAddr->mailbox && !$oAddr->personal)) { 
     540                    if(!$oAddr || ((isset($oAddr)) && !strlen($oAddr->mailbox) && !$oAddr->personal)) { 
    541541                        $sEmail = $sGroup . ':;'; 
    542542                    } 
     
    589589                 } 
    590590            } 
    591             if (!$grouplookup && !$oAddr->mailbox) { 
     591            if (!$grouplookup && !strlen($oAddr->mailbox)) { 
    592592                $oAddr->mailbox = trim($sEmail); 
    593                 if ($sHost && $oAddr->mailbox) { 
     593                if ($sHost && strlen($oAddr->mailbox)) { 
    594594                    $oAddr->host = $sHost; 
    595595                } 
    596596            } else if (!$grouplookup && !$oAddr->host) { 
    597                 if ($sHost && $oAddr->mailbox) { 
     597                if ($sHost && strlen($oAddr->mailbox)) { 
    598598                    $oAddr->host = $sHost; 
    599599                } 
    600600            } 
    601601          } 
    602           if (!$aAddrBookAddress && $oAddr->mailbox) { 
     602          if (!$aAddrBookAddress && strlen($oAddr->mailbox)) { 
    603603              $aProcessedAddress[] = $oAddr; 
    604604          } else { 
     
    930930        } else { 
    931931            if (!is_array($this->cc)) $this->cc = array(); 
     932            if (!is_array($this->to)) $this->to = array(); 
    932933            $srch_addr = $this->parseAddress($address); 
    933934            $results = array(); 
  • trunk/gui/tools/webmail/contrib/squirrelmail.mailto.NT2KXP.reg

    r331 r946  
    1 Here is a windows registry file to set SquirrelMail as a windows email program 
    2 Once this entry is installed, go to Internet Options and select the Programs 
    3 tab.  SquirrelMail should be an option under E-mail: 
     1This file can be used to allow you to jump right to the SquirrelMail compose 
     2screen to send a message when you click on a "mailto" link on any web page 
     3in Windows NT, 2000 or XP (and Vista?). 
     4 
     5Place the contents of this file (make sure to only use the part of this file 
     6below starting on the line after "Cut here") into a text file on the target  
     7computer, named exactly "squirrelmail.mailto.reg" (without the quotes) (make  
     8sure the file extension is in fact ".reg", and not ".txt").  Find the text  
     9"http://example.org/squirrelmail" and change this to the correct address for  
     10your SquirrelMail installation.  When the file has been saved, double-click on 
     11it and confirm that you want to add the information to the registry. 
     12 
     13Once the registry has been updated in this manner, you can now choose  
     14SquirrelMail as your system's default mail program by going to the "Internet 
     15Options" configuration window, which can be found in the Control Panel or in 
     16Internet Explorer by clicking on Tools-->Internet Options.  Choose the 
     17"Programs" tab and SquirrelMail will be an option under "E-mail". 
     18 
    419 
    520---- Cut here ---- 
     
    1934 
    2035[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\SquirrelMail\Protocols\mailto\shell\open\command] 
    21 @="rundll32.exe url.dll,FileProtocolHandler http://mail.server/squirrelmail/src/mailto.php?emailaddress=%1" 
     36@="rundll32.exe url.dll,FileProtocolHandler http://example.org/squirrelmail/src/mailto.php?emailaddress=%1" 
    2237 
    2338[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\SquirrelMail\shell] 
  • trunk/gui/tools/webmail/contrib/squirrelmail.mailto.Win9x.reg

    r331 r946  
    1 Here is a windows registry file to set SquirrelMail as a windows email program 
    2 Once this entry is installed, go to Internet Options and select the Programs 
    3 tab.  SquirrelMail should be an option under E-mail: 
     1This file can be used to allow you to jump right to the SquirrelMail compose 
     2screen to send a message when you click on a "mailto" link on any web page 
     3in Windows 95, 98, 98se, and probably Windows ME. 
     4 
     5Place the contents of this file (make sure to only use the part of this file 
     6below starting on the line after "Cut here") into a text file on the target  
     7computer, named exactly "squirrelmail.mailto.reg" (without the quotes) (make  
     8sure the file extension is in fact ".reg", and not ".txt").  Find the text  
     9"http://example.org/squirrelmail" and change this to the correct address for  
     10your SquirrelMail installation.  When the file has been saved, double-click on 
     11it and confirm that you want to add the information to the registry. 
     12 
     13Once the registry has been updated in this manner, you can now choose  
     14SquirrelMail as your system's default mail program by going to the "Internet 
     15Options" configuration window, which can be found in the Control Panel or in 
     16Internet Explorer by clicking on Tools-->Internet Options.  Choose the 
     17"Programs" tab and SquirrelMail will be an option under "E-mail". 
     18 
    419 
    520---- Cut here ---- 
     
    1934 
    2035[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\SquirrelMail\Protocols\mailto\shell\open\command] 
    21 @="rundll32.exe url.dll,FileProtocolHandler http://mail.server/squirrelmail/src/mailto.php?emailaddress=%1" 
     36@="rundll32.exe url.dll,FileProtocolHandler http://example.org/squirrelmail/src/mailto.php?emailaddress=%1" 
    2237 
    2338[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\SquirrelMail\shell] 
  • trunk/gui/tools/webmail/data/default_pref

    r826 r946  
    22reply_to= 
    33show_html_default=0 
    4 sort=0 
    5 compose_window_type=html 
  • trunk/gui/tools/webmail/functions/addressbook.php

    r703 r946  
    88 * @copyright &copy; 1999-2007 The SquirrelMail Project Team 
    99 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    10  * @version $Id: addressbook.php 12127 2007-01-13 20:07:24Z kink $ 
     10 * @version $Id: addressbook.php 12718 2007-10-01 19:37:52Z pdontthink $ 
    1111 * @package squirrelmail 
    1212 * @subpackage addressbook 
     
    351351 
    352352    function full_address($row) { 
    353         global $addrsrch_fullname, $data_dir, $username; 
    354         $prefix = getPref($data_dir, $username, 'addrsrch_fullname'); 
    355         if (($prefix != "" || (isset($addrsrch_fullname) && 
    356             $prefix == $addrsrch_fullname)) && $prefix != 'noprefix') { 
    357             $name = ($prefix == 'nickname' ? $row['nickname'] : $row['name']); 
    358             return $name . ' <' . trim($row['email']) . '>'; 
    359         } else { 
     353        global $data_dir, $username; 
     354        $addrsrch_fullname = getPref($data_dir, $username, 'addrsrch_fullname'); 
     355        if ($addrsrch_fullname == 'fullname') 
     356            return $row['name'] . ' <' . trim($row['email']) . '>'; 
     357        else if ($addrsrch_fullname == 'nickname') 
     358            return $row['nickname'] . ' <' . trim($row['email']) . '>'; 
     359        else // "noprefix" 
    360360            return trim($row['email']); 
    361         } 
    362361    } 
    363362 
  • trunk/gui/tools/webmail/functions/auth.php

    r821 r946  
    88 * @copyright &copy; 1999-2007 The SquirrelMail Project Team 
    99 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    10  * @version $Id: auth.php 12629 2007-08-29 23:59:12Z pdontthink
     10 * @version $Id: auth.php 12746 2007-10-30 16:28:43Z jangliss
    1111 * @package squirrelmail 
    1212 */ 
     
    5555        //  information-loss. 
    5656        $session_expired_post = $_POST; 
    57         $session_expired_location = PAGE_NAME; 
     57        if (defined('PAGE_NAME')) { 
     58            $session_expired_location = PAGE_NAME; 
     59        } 
     60         
    5861        if (!sqsession_is_registered('session_expired_post')) { 
    5962            sqsession_register($session_expired_post,'session_expired_post'); 
  • trunk/gui/tools/webmail/functions/display_messages.php

    r821 r946  
    99 * @copyright &copy; 1999-2007 The SquirrelMail Project Team 
    1010 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    11  * @version $Id: display_messages.php 12576 2007-08-09 06:49:27Z pdontthink $ 
     11 * @version $Id: display_messages.php 12797 2007-12-01 02:29:12Z pdontthink $ 
    1212 * @package squirrelmail 
    1313 */ 
     
    2727              '<a href="'.sqm_baseuri()."src/right_main.php?sort=$sort&amp;startMessage=$startMessage&amp;mailbox=$urlMailbox\">"; 
    2828 
    29     if (strpos($mailbox, $default_folder_prefix) === 0) 
    30         $mailbox = substr($mailbox, strlen($default_folder_prefix)); 
    31  
     29    if (!empty($default_folder_prefix)) { 
     30        if (strpos($mailbox, $default_folder_prefix) === 0) 
     31            $mailbox = substr($mailbox, strlen($default_folder_prefix)); 
     32    } 
     33     
    3234    $string .= sprintf (_("Click here to return to %s"), 
    3335                  htmlspecialchars(imap_utf7_decode_local($mailbox))). 
     
    4547           $color, $theme, $theme_default; 
    4648 
     49    include_once( SM_PATH . 'functions/page_header.php' ); 
     50 
    4751    $base_uri = sqm_baseuri(); 
    4852 
    49     include_once( SM_PATH . 'functions/page_header.php' )
    50     if ( !isset( $org_logo ) ) { 
    51         // Don't know yet why, but in some accesses $org_logo is not set. 
    52         include( SM_PATH . 'config/config.php' ); 
    53     } 
     53    $logout_link = $base_uri . 'src/login.php'
     54 
     55    list($junk, $errString, $errTitle, $logout_link)  
     56        = do_hook('logout_error', $errString, $errTitle, $logout_link); 
     57 
    5458    /* Display width and height like good little people */ 
    5559    $width_and_height = ''; 
     
    7882        $color[8]  = '#000000';  /* black         Normal text            */ 
    7983    } 
    80  
    81     $logout_link = $base_uri . 'src/login.php'; 
    82  
    83     list($junk, $errString, $errTitle, $logout_link)  
    84         = do_hook('logout_error', $errString, $errTitle, $logout_link); 
    8584 
    8685    if ( $errTitle == '' ) { 
  • trunk/gui/tools/webmail/functions/global.php

    r821 r946  
    66 * @copyright &copy; 1999-2007 The SquirrelMail Project Team 
    77 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    8  * @version $Id: global.php 12546 2007-07-16 22:27:13Z kink
     8 * @version $Id: global.php 12793 2007-11-27 21:26:57Z jangliss
    99 * @package squirrelmail 
    1010 */ 
     
    186186 
    187187/** 
     188 * Squelch error output to screen (only) for the given function. 
     189 * 
     190 * This provides an alternative to the @ error-suppression 
     191 * operator where errors will not be shown in the interface 
     192 * but will show up in the server log file (assuming the 
     193 * administrator has configured PHP logging). 
     194 *  
     195 * @since 1.4.12 and 1.5.2 
     196 *  
     197 * @param string $function The function to be executed 
     198 * @param array  $args     The arguments to be passed to the function 
     199 *                         (OPTIONAL; default no arguments) 
     200 *                         NOTE: The caller must take extra action if 
     201 *                               the function being called is supposed 
     202 *                               to use any of the parameters by  
     203 *                               reference.  In the following example, 
     204 *                               $x is passed by reference and $y is 
     205 *                               passed by value to the "my_func" 
     206 *                               function. 
     207 * sq_call_function_suppress_errors('my_func', array(&$x, $y)); 
     208 *  
     209 * @return mixed The return value, if any, of the function being 
     210 *               executed will be returned. 
     211 *  
     212 */  
     213function sq_call_function_suppress_errors($function, $args=NULL) { 
     214   $display_errors = ini_get('display_errors'); 
     215   ini_set('display_errors', '0'); 
     216   $ret = call_user_func_array($function, $args); 
     217   ini_set('display_errors', $display_errors); 
     218   return $ret; 
     219} 
     220 
     221/** 
    188222 * Add a variable to the session. 
    189223 * @param mixed $var the variable to register 
     
    313347    global $base_uri; 
    314348 
    315     if (isset($_COOKIE[session_name()])) setcookie(session_name(), '', 0, $base_uri); 
    316     if (isset($_COOKIE['username'])) setcookie('username', '', 0, $base_uri); 
    317     if (isset($_COOKIE['key'])) setcookie('key', '', 0, $base_uri); 
     349    if (isset($_COOKIE[session_name()])) setcookie(session_name(), $_COOKIE[session_name()], 1, $base_uri); 
     350    if (isset($_COOKIE['key'])) setcookie('key', 'SQMTRASH', 1, $base_uri); 
    318351 
    319352    $sessid = session_id(); 
  • trunk/gui/tools/webmail/functions/imap_messages.php

    r821 r946  
    99 * @copyright &copy; 1999-2007 The SquirrelMail Project Team 
    1010 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    11  * @version $Id: imap_messages.php 12690 2007-09-15 01:35:02Z pdontthink
     11 * @version $Id: imap_messages.php 12769 2007-11-19 04:21:49Z jangliss
    1212 * @package squirrelmail 
    1313 * @subpackage imap 
     
    144144                      3=> 'FROM', 
    145145                      4=> 'SUBJECT', 
    146                       5=> 'SUBJECT'); 
     146                      5=> 'SUBJECT', 
     147                      8=> 'SIZE', 
     148                      9=> 'SIZE'); 
    147149    if ($internal_date_sort == true) { 
    148150        $sort_on[0] = 'ARRIVAL'; 
     
    167169    } 
    168170 
    169     if ($sort == 0 || $sort == 2 || $sort == 4) { 
     171    if ($sort == 0 || $sort == 2 || $sort == 4 || $sort == 8) { 
    170172       $server_sort_array = array_reverse($server_sort_array); 
    171173    } 
  • trunk/gui/tools/webmail/functions/mailbox_display.php

    r821 r946  
    99 * @copyright &copy; 1999-2007 The SquirrelMail Project Team 
    1010 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    11  * @version $Id: mailbox_display.php 12680 2007-09-06 07:42:09Z pdontthink
     11 * @version $Id: mailbox_display.php 12770 2007-11-19 05:26:16Z jangliss
    1212 * @package squirrelmail 
    1313 */ 
     
    346346    if ($num_msgs >= 1) { 
    347347        $id = sqimap_get_php_sort_order ($imapConnection, $mbxresponse); 
    348         if ($sort < 6 ) { 
     348        if ($sort != 6 ) { 
    349349            $end = $num_msgs; 
    350350            $end_loop = $end; 
     
    553553     * 4 = Subject (up) 
    554554     * 5 = Subject (dn) 
     555     * 6 = default no sort 
     556     * 7 - UNUSED 
     557     * 8 = Size (up) 
     558     * 9 = Size (dn) 
    555559     */ 
    556560 
     
    567571            $msort[] = $item['SUBJECT-SORT']; 
    568572        } 
     573    } elseif (($sort == 8) || ($sort == 9)) { 
     574       foreach ($msgs as $item) { 
     575           $msort[] = $item['SIZE']; 
     576       } 
    569577    } else { 
    570578        $msort = $msgs; 
    571579    } 
    572     if ($sort < 6) { 
     580    if ($sort != 6) { 
    573581        if ($sort % 2) { 
    574582            asort($msort); 
     
    873881            break; 
    874882        case 6: /* size */ 
    875             echo html_tag( 'td', '<b>' . _("Size") . '</b>', 'center', '', 'width="5%" nowrap' ); 
     883            echo html_tag( 'td' ,'' , 'left', '', 'width="5%" nowrap' ) 
     884                 . '<b>' . _("Size") . '</b>'; 
     885            if ($showsort) { 
     886                ShowSortButton($sort, $mailbox, 8, 9); 
     887            } 
     888            echo "</td>\n"; 
    876889            break; 
    877890        } 
  • trunk/gui/tools/webmail/functions/mime.php

    r821 r946  
    99 * @copyright &copy; 1999-2007 The SquirrelMail Project Team 
    1010 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    11  * @version $Id: mime.php 12396 2007-05-17 15:20:55Z kink
     11 * @version $Id: mime.php 12803 2007-12-05 20:21:46Z jangliss
    1212 * @package squirrelmail 
    1313 */ 
     
    128128    } else if (ereg('"([^"]*)"', $topline, $regs)) { 
    129129        $ret = $regs[1]; 
     130    } else if ((stristr($topline, 'nil') !== false) && (empty($wholemessage))) { 
     131        $ret = $wholemessage; 
    130132    } else { 
    131133        global $where, $what, $mailbox, $passed_id, $startMessage; 
     
    17051707            if (isset($aUrl['scheme'])) { 
    17061708                switch(strtolower($aUrl['scheme'])) { 
     1709                    case 'mailto': 
    17071710                    case 'http': 
    17081711                    case 'https': 
     
    21812184 * @param  $body  the body of the message 
    21822185 * @param  $id    the id of the message 
     2186 * @param  boolean $take_mailto_links When TRUE, converts mailto: links 
     2187 *                                    into internal SM compose links 
     2188 *                                    (optional; default = TRUE) 
    21832189 * @return        a string with html safe to display in the browser. 
    21842190 */ 
    2185 function magicHTML($body, $id, $message, $mailbox = 'INBOX') { 
     2191function magicHTML($body, $id, $message, $mailbox = 'INBOX', $take_mailto_links =true) { 
     2192 
     2193    // require_once(SM_PATH . 'functions/url_parser.php');  // for $MailTo_PReg_Match 
     2194 
    21862195    global $attachment_common_show_images, $view_unsafe_images, 
    21872196           $has_unsafe_images; 
     
    23352344        $has_unsafe_images = true; 
    23362345    } 
     2346 
     2347    // we want to parse mailto's in HTML output, change to SM compose links 
     2348    // this is a modified version of code from url_parser.php... but Marc is 
     2349    // right: we need a better filtering implementation; adding this randomly 
     2350    // here is not a great solution 
     2351    // 
     2352    if ($take_mailto_links) { 
     2353        // parseUrl($trusted);   // this even parses URLs inside of tags... too aggressive 
     2354        global $MailTo_PReg_Match; 
     2355        $MailTo_PReg_Match = '/mailto:' . substr($MailTo_PReg_Match, 1) ; 
     2356        if ((preg_match_all($MailTo_PReg_Match, $trusted, $regs)) && ($regs[0][0] != '')) { 
     2357            foreach ($regs[0] as $i => $mailto_before) { 
     2358                $mailto_params = $regs[10][$i]; 
     2359                // get rid of any tailing quote since we have to add send_to to the end 
     2360                // 
     2361                if (substr($mailto_before, strlen($mailto_before) - 1) == '"') 
     2362                    $mailto_before = substr($mailto_before, 0, strlen($mailto_before) - 1); 
     2363                if (substr($mailto_params, strlen($mailto_params) - 1) == '"') 
     2364                    $mailto_params = substr($mailto_params, 0, strlen($mailto_params) - 1); 
     2365 
     2366                if ($regs[1][$i]) {    //if there is an email addr before '?', we need to merge it with the params 
     2367                    $to = 'to=' . $regs[1][$i]; 
     2368                    if (strpos($mailto_params, 'to=') > -1)    //already a 'to=' 
     2369                        $mailto_params = str_replace('to=', $to . '%2C%20', $mailto_params); 
     2370                    else { 
     2371                        if ($mailto_params)    //already some params, append to them 
     2372                            $mailto_params .= '&amp;' . $to; 
     2373                        else 
     2374                            $mailto_params .= '?' . $to; 
     2375                    } 
     2376                } 
     2377 
     2378                $url_str = preg_replace(array('/to=/i', '/(?<!b)cc=/i', '/bcc=/i'), array('send_to=', 'send_to_cc=', 'send_to_bcc='), $mailto_params); 
     2379 
     2380                // we'll already have target=_blank, no need to allow comp_in_new 
     2381                // here (which would be a lot more work anyway) 
     2382                // 
     2383                global $compose_new_win; 
     2384                $temp_comp_in_new = $compose_new_win; 
     2385                $compose_new_win = 0; 
     2386                $comp_uri = makeComposeLink('src/compose.php' . $url_str, $mailto_before); 
     2387                $compose_new_win = $temp_comp_in_new; 
     2388 
     2389                // remove <a href=" and anything after the next quote (we only 
     2390                // need the uri, not the link HTML) in compose uri 
     2391                // 
     2392                $comp_uri = substr($comp_uri, 9); 
     2393                $comp_uri = substr($comp_uri, 0, strpos($comp_uri, '"', 1)); 
     2394                $trusted = str_replace($mailto_before, $comp_uri, $trusted); 
     2395            } 
     2396        } 
     2397    } 
     2398 
    23372399    return $trusted; 
    23382400} 
  • trunk/gui/tools/webmail/functions/page_header.php

    r826 r946  
    1919 
    2020/* Always set up the language before calling these functions */ 
    21 function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE) { 
     21function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { 
    2222    global $squirrelmail_language; 
    2323 
     
    2525        global $base_uri; 
    2626    } 
    27     global $theme_css, $custom_css, $pageheader_sent, $minimize_button
     27    global $theme_css, $custom_css, $pageheader_sent
    2828 
    2929    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' . 
     
    3333    if ( !isset( $custom_css ) || $custom_css == 'none' ) { 
    3434        if ($theme_css != '') { 
    35             echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$theme_css\" />"; 
     35            echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$theme_css\">"; 
    3636        } 
    3737    } else { 
    3838        echo '<link rel="stylesheet" type="text/css" href="' . 
    39              $base_uri . 'themes/css/'.$custom_css.'" />'; 
     39             $base_uri . 'themes/css/'.$custom_css.'">'; 
    4040    } 
    4141 
     
    4343        // Why is it added here? Header ('Content-Type:..) is used in i18n.php 
    4444        echo "<!-- \xfd\xfe -->\n"; 
    45         echo '<meta http-equiv="Content-type" content="text/html; charset=euc-jp" />' . "\n"; 
     45        echo '<meta http-equiv="Content-type" content="text/html; charset=euc-jp">' . "\n"; 
    4646    } 
    4747 
     
    6464 
    6565ECHO; 
    66 echo <<<END 
    67 <script type="text/javascript"> 
    68 function reveal(myvar){ 
    69 t=document.getElementById(myvar); 
    70 if(t.style.display=='none'){t.style.display='block';}else{t.style.display='none';} 
    71 
    72 </script> 
    73 END; 
     66 
    7467    echo "\n</head>\n\n"; 
    7568 
     
    9285function displayPageHeader($color, $mailbox, $xtra='', $session=false) { 
    9386 
    94     global $hide_sm_attributions, $PHP_SELF, $frame_top,