Changeset 1709

Show
Ignore:
Timestamp:
01/13/2008 01:04:05 PM (12 months ago)
Author:
Shadowhand
Message:

Fixing #287, thanks Inquisitus.

Files:
1 modified

Legend:

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

    r1605 r1709  
    233233                } 
    234234 
    235                 // Find the URI string based on the location of the front controller 
    236                 if (($offset = strpos(self::$current_uri, KOHANA)) !== FALSE) 
    237                 { 
    238                         // Add the length of the index file to the offset 
    239                         $offset += strlen(KOHANA); 
    240  
    241                         // Get the segment part of the URL 
    242                         self::$current_uri = substr(self::$current_uri, $offset); 
    243                         self::$current_uri = trim(self::$current_uri, '/'); 
     235                // The front controller directory and filename 
     236                $fc = substr($_SERVER['SCRIPT_FILENAME'], strlen($_SERVER['DOCUMENT_ROOT'])); 
     237 
     238                if (strpos(self::$current_uri, $fc) === 0) 
     239                { 
     240                        // Remove the front controller from the current uri 
     241                        self::$current_uri = substr(self::$current_uri, strlen($fc)); 
    244242                } 
    245243