Show
Ignore:
Timestamp:
10/04/2007 03:32:31 PM (14 months ago)
Author:
Shadowhand
Message:

Updated Input, replacing xss_clean() with a function by Christian Stocker. This function is blazing fast and does most of the right stuff.

Other changes are spit shine.

Files:
1 modified

Legend:

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

    r644 r648  
    3535        public function library($name, $config = array()) 
    3636        { 
     37                if (isset(Kohana::instance()->$name)) 
     38                        return FALSE; 
     39 
    3740                Kohana::instance()->$name = Kohana::load_class(ucfirst($name), $config); 
    3841        } 
     
    4043        public function database($group = 'default', $return = FALSE) 
    4144        { 
     45                // Return the new database object 
    4246                if ($return == TRUE) 
    4347                { 
     
    4650                else 
    4751                { 
     52                        // Set the database object to Controller->db 
    4853                        Kohana::instance()->db = new Database($group); 
    4954                } 
     
    5257        public function helper($name) 
    5358        { 
     59                // Allow recursive loading 
    5460                if (is_array($name)) 
    5561                { 
     
    6975        public function model($name, $alias = FALSE) 
    7076        { 
     77                // The alias is used for Controller->alias 
    7178                $alias = ($alias == FALSE) ? $name : $alias; 
     79 
     80                if (isset(Kohana::instance()->$alias)) 
     81                        return FALSE; 
     82 
     83                // Load the model 
    7284                Kohana::instance()->$alias = Kohana::load_class(ucfirst($name).'_Model'); 
     85 
     86                // Load Database into the DB 
    7387                Kohana::instance()->$alias->db = (isset(Kohana::instance()->db)) ? Kohana::instance()->db : new Database('default'); 
    7488        } 
     
    7690        public function view($name, $data = array()) 
    7791        { 
     92                // Fancy! *wink* 
    7893                return new View($name, $data); 
    7994        }