Changeset d5342aa in github for program/include/rcube_imap.inc


Ignore:
Timestamp:
Nov 25, 2007 2:45:38 PM (6 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
1107480
Parents:
c579961
Message:

More input sanitizing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_imap.inc

    rc007e6a rd5342aa  
    66 |                                                                       | 
    77 | This file is part of the RoundCube Webmail client                     | 
    8  | Copyright (C) 2005-2006, RoundCube Dev. - Switzerland                 | 
     8 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 | 
    99 | Licensed under the GNU GPL                                            | 
    1010 |                                                                       | 
     
    3636 * @package    Mail 
    3737 * @author     Thomas Bruederli <roundcube@gmail.com> 
    38  * @version    1.39 
     38 * @version    1.40 
    3939 * @link       http://ilohamail.org 
    4040 */ 
     
    528528      return $this->_list_header_set($mailbox, $this->search_set, $page, $sort_field, $sort_order); 
    529529 
    530     if ($sort_field!=NULL) 
    531       $this->sort_field = $sort_field; 
    532     if ($sort_order!=NULL) 
    533       $this->sort_order = strtoupper($sort_order); 
     530    $this->_set_sort_order($sort_field, $sort_order); 
    534531 
    535532    $max = $this->_messagecount($mailbox); 
     
    648645      return array(); 
    649646 
    650     if ($sort_field!=NULL) 
    651       $this->sort_field = $sort_field; 
    652     if ($sort_order!=NULL) 
    653       $this->sort_order = strtoupper($sort_order); 
     647    $this->_set_sort_order($sort_field, $sort_order); 
    654648 
    655649    $max = count($msgs); 
     
    765759  function message_index($mbox_name='', $sort_field=NULL, $sort_order=NULL) 
    766760    { 
    767     if ($sort_field!=NULL) 
    768       $this->sort_field = $sort_field; 
    769     if ($sort_order!=NULL) 
    770       $this->sort_order = strtoupper($sort_order); 
     761    $this->_set_sort_order($sort_field, $sort_order); 
    771762 
    772763    $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox; 
     
    24462437    } 
    24472438 
     2439  /** 
     2440   * Validate the given input and save to local properties 
     2441   * @access private 
     2442   */ 
     2443  function _set_sort_order($sort_field, $sort_order) 
     2444  { 
     2445    if ($sort_field != null) 
     2446      $this->sort_field = asciiwords($sort_field); 
     2447    if ($sort_order != null) 
     2448      $this->sort_order = strtoupper($sort_order) == 'DESC' ? 'DESC' : 'ASC'; 
     2449  } 
    24482450 
    24492451  /** 
Note: See TracChangeset for help on using the changeset viewer.