Changeset 595 in subversion


Ignore:
Timestamp:
Jun 5, 2007 12:26:02 PM (6 years ago)
Author:
till
Message:

+ removed patch

  • fixed a bug i introduced yesterdayish (send flag)

+ don't allow GET to bin/html2text.php

Location:
branches/devel-vnext
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-vnext/bin/html2text.php

    r589 r595  
    11<?php 
     2if ($_SERVER['REQUEST_METHOD'] == 'GET') { 
     3    echo 'Method not allowed.'; 
     4    exit; 
     5} 
     6require_once dirname(__FILE__) . '/../program/lib/html2text.inc'; 
    27 
    3 require_once('../program/lib/html2text.inc'); 
    4  
    5 $htmlText = $HTTP_RAW_POST_DATA; 
     8$htmlText  = $HTTP_RAW_POST_DATA; 
    69$converter = new html2text($htmlText); 
    710 
     
    912$plaintext = $converter->get_text(); 
    1013 
    11 if (function_exists('html_entity_decode')) 
    12         print html_entity_decode($plaintext, ENT_COMPAT, 'UTF-8'); 
    13 else 
    14         print $plaintext; 
    15  
     14if (function_exists('html_entity_decode')) { 
     15    echo html_entity_decode($plaintext, ENT_COMPAT, 'UTF-8'); 
     16} 
     17else { 
     18    echo $plaintext; 
     19} 
    1620?> 
  • branches/devel-vnext/index.php

    r594 r595  
    113113require_once 'include/main.inc'; 
    114114require_once 'include/cache.inc'; 
    115 require_once 'lib/html2text.inc'; 
    116115require_once 'PEAR.php'; 
    117116 
     
    175174if ($_action=='error' && !empty($_GET['_code'])) { 
    176175    raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE); 
    177 } 
    178  
    179 // handle HTML->text conversion 
    180 if ($_action=='html2text') { 
    181     $htmlText  = $HTTP_RAW_POST_DATA; 
    182         $converter = new html2text($htmlText); 
    183  
    184         // TODO possibly replace with rcube_remote_response() 
    185         header('Content-Type: text/plain'); 
    186         $plaintext = $converter->get_text(); 
    187         echo $plaintext; 
    188         exit; 
    189176} 
    190177 
  • branches/devel-vnext/program/include/rcube_imap.inc

    r592 r595  
    12851285 
    12861286 
    1287   /** 
    1288    * Set message flag to one or several messages 
    1289    * 
    1290    * @param mixed  Message UIDs as array or as comma-separated string 
    1291    * @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT 
    1292    * @return True on success, False on failure 
    1293    */ 
    1294   function set_flag($uids, $flag) 
    1295     { 
    1296     $flag = strtoupper($flag); 
    1297     $msg_ids = array(); 
    1298     if (!is_array($uids)) 
    1299       $uids = explode(',',$uids); 
    1300  
    1301     foreach ($uids as $uid) { 
    1302       $msg_ids[$uid] = $this->_uid2id($uid); 
    1303     } 
    1304  
    1305     if ($flag=='UNDELETED') 
    1306       $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 
    1307     else if ($flag=='UNSEEN') 
    1308       $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 
    1309     else 
    1310       $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag); 
    1311  
    1312     // reload message headers if cached 
    1313     $cache_key = $this->mailbox.'.msg'; 
    1314     if ($this->caching_enabled) 
    1315       { 
    1316       foreach ($msg_ids as $uid => $id) 
    1317         { 
    1318         if ($cached_headers = $this->get_cached_message($cache_key, $uid)) 
    1319           { 
    1320           $this->remove_message_cache($cache_key, $id); 
    1321           //$this->get_headers($uid); 
    1322           } 
    1323         } 
    1324  
    1325       // close and re-open connection 
    1326       // this prevents connection problems with Courier 
    1327       $this->reconnect(); 
    1328       } 
    1329  
    1330     // set nr of messages that were flaged 
    1331     $count = count($msg_ids); 
    1332  
    1333     // clear message count cache 
    1334     if ($result && $flag=='SEEN') 
    1335       $this->_set_messagecount($this->mailbox, 'UNSEEN', $count*(-1)); 
    1336     else if ($result && $flag=='UNSEEN') 
    1337       $this->_set_messagecount($this->mailbox, 'UNSEEN', $count); 
    1338     else if ($result && $flag=='DELETED') 
    1339       $this->_set_messagecount($this->mailbox, 'ALL', $count*(-1)); 
    1340  
    1341     return $result; 
    1342     } 
    1343  
    1344  
    1345   // append a mail message (source) to a specific mailbox 
    1346   function save_message($mbox_name, &$message) 
    1347     { 
    1348     $mbox_name = stripslashes($mbox_name); 
    1349     $mailbox = $this->_mod_mailbox($mbox_name); 
    1350  
    1351     // make sure mailbox exists 
    1352     if (in_array($mailbox, $this->_list_mailboxes())) 
    1353       $saved = iil_C_Append($this->conn, $mailbox, $message); 
    1354  
    1355     if ($saved) 
    1356       { 
    1357       // increase messagecount of the target mailbox 
    1358       $this->_set_messagecount($mailbox, 'ALL', 1); 
    1359       } 
    1360  
    1361     return $saved; 
     1287    /** 
     1288     * Set message flag to one or several messages 
     1289     * 
     1290     * @param mixed  Message UIDs as array or as comma-separated string 
     1291     * @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT 
     1292     * @return True on success, False on failure 
     1293     */ 
     1294    function set_flag($uids, $flag) 
     1295    { 
     1296        $flag = strtoupper($flag); 
     1297        $msg_ids = array(); 
     1298        if (!is_array($uids)) { 
     1299            $uids = explode(',',$uids); 
     1300        } 
     1301        foreach ($uids as $uid) { 
     1302            $msg_ids[$uid] = $this->_uid2id($uid); 
     1303        } 
     1304 
     1305        if ($flag=='UNDELETED') { 
     1306            $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 
     1307        } 
     1308        elseif ($flag=='UNSEEN') { 
     1309            $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 
     1310        } 
     1311        else { 
     1312            $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag); 
     1313        } 
     1314        //tfk_debug($result); 
     1315        // reload message headers if cached 
     1316        $cache_key = $this->mailbox.'.msg'; 
     1317        if ($this->caching_enabled) { 
     1318            foreach ($msg_ids as $uid => $id) { 
     1319                if ($cached_headers = $this->get_cached_message($cache_key, $uid)) { 
     1320                    $this->remove_message_cache($cache_key, $id); 
     1321                    //$this->get_headers($uid); 
     1322                } 
     1323            } 
     1324 
     1325            // close and re-open connection 
     1326            // this prevents connection problems with Courier 
     1327            $this->reconnect(); 
     1328        } 
     1329 
     1330        // set nr of messages that were flaged 
     1331        $count = count($msg_ids); 
     1332 
     1333        // clear message count cache 
     1334        if ($result && $flag=='SEEN') { 
     1335            $this->_set_messagecount($this->mailbox, 'UNSEEN', $count*(-1)); 
     1336        } 
     1337        elseif ($result && $flag=='UNSEEN') { 
     1338            $this->_set_messagecount($this->mailbox, 'UNSEEN', $count); 
     1339        } 
     1340        elseif ($result && $flag=='DELETED') { 
     1341            $this->_set_messagecount($this->mailbox, 'ALL', $count*(-1)); 
     1342        } 
     1343        return $result; 
     1344    } 
     1345 
     1346 
     1347    // append a mail message (source) to a specific mailbox 
     1348    function save_message($mbox_name, &$message) 
     1349    { 
     1350        $mbox_name = stripslashes($mbox_name); 
     1351        $mailbox = $this->_mod_mailbox($mbox_name); 
     1352 
     1353        // make sure mailbox exists 
     1354        if (in_array($mailbox, $this->_list_mailboxes())) { 
     1355            $saved = iil_C_Append($this->conn, $mailbox, $message); 
     1356        } 
     1357        if ($saved) { 
     1358            // increase messagecount of the target mailbox 
     1359            $this->_set_messagecount($mailbox, 'ALL', 1); 
     1360        } 
     1361        return $saved; 
    13621362    } 
    13631363 
  • branches/devel-vnext/program/steps/mail/sendmail.inc

    r592 r595  
    409409            return; 
    410410        } 
    411  
    412  
    413         // set repliead flag 
    414         if ($_SESSION['compose']['reply_uid']) { 
    415             $IMAP->set_flag($_SESSION['compose']['reply_uid'], 'ANSWERED'); 
    416         } 
    417411    } // End of SMTP Delivery Block 
     412    // set repliead flag 
     413    if ($_SESSION['compose']['reply_uid']) { 
     414        $IMAP->set_flag($_SESSION['compose']['reply_uid'], 'ANSWERED'); 
     415    } 
    418416} 
    419417// Determine which folder to save message 
Note: See TracChangeset for help on using the changeset viewer.