Changeset 3048

Show
Ignore:
Timestamp:
07/11/2008 07:26:30 AM (5 months ago)
Author:
Shadowhand
Message:

Fixing #684, thanks Spoofed Existence!

Files:
1 modified

Legend:

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

    r3014 r3048  
    6868 
    6969                // At this point segments, rsegments, and current URI are all the same 
    70                 self::$segments = self::$rsegments = self::$current_uri = trim(self::$current_uri, '/'); 
     70                // We trim off periods, slashes, and spaces to prevent malicious attacks 
     71                // using ../../ URIs. 
     72                self::$segments = self::$rsegments = self::$current_uri = trim(self::$current_uri, './ '); 
     73 
     74                echo Kohana::debug(self::$segments);exit; 
    7175 
    7276                // Set the complete URI 
     
    8993                $method_segment  = NULL; 
    9094 
     95                // Paths to search 
     96                $paths = Config::include_paths(); 
     97 
    9198                foreach (self::$rsegments as $key => $segment) 
    9299                { 
     
    94101                        $controller_path .= $segment; 
    95102 
     103                        echo Kohana::debug($segment); 
     104 
    96105                        $found = FALSE; 
    97                         $paths = Config::include_paths(); 
    98  
    99106                        foreach ($paths as $dir) 
    100107                        { 
     
    149156                } 
    150157 
     158                exit; 
    151159                // Last chance to set routing before a 404 is triggered 
    152160                Event::run('system.post_routing');