Changeset 3058

Show
Ignore:
Timestamp:
07/11/2008 09:04:05 AM (3 months ago)
Author:
Shadowhand
Message:

Follow up to r3049, fixing #684.

Files:
1 modified

Legend:

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

    r3051 r3058  
    6767                self::$current_uri = html::specialchars(self::$current_uri, FALSE); 
    6868 
     69                // Remove all dot-paths from the URI, they are not valid 
     70                self::$current_uri = str_replace(array('../', './'), '', self::$current_uri); 
     71 
    6972                // At this point segments, rsegments, and current URI are all the same 
    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                self::$segments = self::$rsegments = self::$current_uri = trim(self::$current_uri, '/'); 
    7374 
    7475                // Set the complete URI 
     
    112113                                        if (is_file($dir.$controller_path.EXT)) 
    113114                                        { 
    114                                                 // Set controller subdirectory if any 
    115                                                 self::$controller_dir = substr($controller_path, 0, strrpos($controller_path, '/')); 
    116  
    117115                                                // Set controller name 
    118116                                                self::$controller = $segment;