Changeset 2239

Show
Ignore:
Timestamp:
03/08/2008 03:57:44 AM (10 months ago)
Author:
Geert
Message:

Cleaning up security helper

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/security.php

    r1725 r2239  
    2020        public static function xss_clean($str) 
    2121        { 
    22                 static $input; 
    23  
    24                 if ($input === NULL) 
    25                 { 
    26                         $input = new Input(); 
    27                 } 
    28  
    29                 return $input->xss_clean($str); 
     22                return Input::instance()->xss_clean($str); 
    3023        } 
    3124 
     
    3831        public static function strip_image_tags($str) 
    3932        { 
    40                 $str = preg_replace('#<img\b.*?(?:src\s*=\s*["\']?([^"\'<>\s]*)["\']?[^>]*)?>#is', '$1', $str); 
    41  
    42                 return trim($str); 
     33                return preg_replace('#<img\s.*?(?:src\s*=\s*["\']?([^"\'<>\s]*)["\']?[^>]*)?>#is', '$1', $str); 
    4334        } 
    4435 
     
    5142        public static function encode_php_tags($str) 
    5243        { 
    53                 return str_replace(array('<?', '?>'),  array('&lt;?', '?&gt;'), $str); 
     44                return str_replace(array('<?', '?>'), array('&lt;?', '?&gt;'), $str); 
    5445        } 
    5546