Show
Ignore:
Timestamp:
03/16/2008 03:34:43 AM (10 months ago)
Author:
Geert
Message:

Cleanup Input.

Files:
1 modified

Legend:

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

    r1911 r2309  
    3535 
    3636        /** 
    37          * Sets whether to globally enable the XSS processing. 
     37         * Sanitizes global GET, POST and COOKIE data. Also takes care of 
     38         * register_globals, if it has been enabled. 
     39         * 
     40         * @return  void 
    3841         */ 
    3942        public function __construct() 
     
    219222                $chars = (PCRE_UNICODE_PROPERTIES) ? '\pL' : 'a-zA-Z'; 
    220223 
    221                 if ( ! preg_match('#^['.$chars.'0-9:_/-]+$#uD', $str)) 
     224                if ( ! preg_match('#^['.$chars.'0-9:_/-]++$#uD', $str)) 
    222225                { 
    223226                        exit('Disallowed key characters in global data.'); 
     
    255258 
    256259                if ($this->ip_address === FALSE) 
    257                 { 
    258                         $this->ip_address = '0.0.0.0'; 
    259                         return $this->ip_address; 
    260                 } 
     260                        return $this->ip_address = '0.0.0.0'; 
    261261 
    262262                if (strstr($this->ip_address, ',')) 
     
    266266                } 
    267267 
    268                 if ( ! $this->valid_ip($this->ip_address)) 
     268                if ( ! valid::ip($this->ip_address)) 
    269269                { 
    270270                        $this->ip_address = '0.0.0.0'; 
     
    321321 
    322322                // Do not clean empty strings 
    323                 if (trim($string) == '') 
     323                if (trim($string) === '') 
    324324                        return $string; 
    325325 
     
    406406                                        $oldstring = $string; 
    407407                                        $string = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*>#i', '', $string); 
    408                                 } while ($oldstring != $string); 
     408                                } 
     409                                while ($oldstring !== $string); 
    409410                        break; 
    410411                }