Show
Ignore:
Timestamp:
06/27/2008 02:28:42 PM (5 months ago)
Author:
zombor
Message:

Update to r2922, adding support to return entire array with input->post()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Input.php

    r2926 r2930  
    131131         * @return  mixed 
    132132         */ 
    133         public function get($key, $default = NULL, $xss_clean = FALSE) 
     133        public function get($key = array(), $default = NULL, $xss_clean = FALSE) 
    134134        { 
    135135                return $this->search_array($_GET, $key, $default, $xss_clean); 
     
    144144         * @return  mixed 
    145145         */ 
    146         public function post($key, $default = NULL, $xss_clean = FALSE) 
     146        public function post($key = array(), $default = NULL, $xss_clean = FALSE) 
    147147        { 
    148148                return $this->search_array($_POST, $key, $default, $xss_clean); 
     
    157157         * @return  mixed 
    158158         */ 
    159         public function cookie($key, $default = NULL, $xss_clean = FALSE) 
     159        public function cookie($key = array(), $default = NULL, $xss_clean = FALSE) 
    160160        { 
    161161                return $this->search_array($_COOKIE, $key, $default, $xss_clean); 
     
    170170         * @return  mixed 
    171171         */ 
    172         public function server($key, $default = NULl, $xss_clean = FALSE) 
     172        public function server($key = array(), $default = NULL, $xss_clean = FALSE) 
    173173        { 
    174174                return $this->search_array($_SERVER, $key, $default, $xss_clean); 
     
    186186        protected function search_array(array $array, $key, $default = NULL, $xss_clean = FALSE) 
    187187        { 
     188                if ($key === array()) 
     189                        return $array; 
     190 
    188191                // Get the value from the array 
    189192                $value = isset($array[$key]) ? $array[$key] : $default;