Changeset 3396

Show
Ignore:
Timestamp:
08/29/2008 12:29:17 PM (3 months ago)
Author:
Shadowhand
Message:

A real fix for r3393

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/classes/router.php

    r3395 r3396  
    7373                        { 
    7474                                // If matches exist and there are keys for the URI, parse them 
    75                                 if ($keys = Router::keys($route[0])) 
     75                                if (count($matches) > 1 AND $keys = Router::keys($route[0])) 
    7676                                { 
    7777                                        // Remove the matched string 
     
    9191                                                        $route[$key] = $matches[$i]; 
    9292                                                } 
    93  
    94                                                 if (isset($route['prefix'][$key])) 
     93                                        } 
     94                                } 
     95 
     96                                if (isset($route['prefix'])) 
     97                                { 
     98                                        foreach ($route['prefix'] as $key => $prefix) 
     99                                        { 
     100                                                if (isset($route[$key])) 
    95101                                                { 
    96102                                                        // Add the prefix to the key 
    97103                                                        $route[$key] = $route['prefix'][$key].$route[$key]; 
    98104                                                } 
    99  
    100                                                 if ($key !== 'controller' AND $key !== 'method' AND isset($route[$key])) 
    101                                                 { 
    102                                                         // Add the value to the arguments 
    103                                                         self::$arguments[$key] = $route[$key]; 
    104                                                 } 
    105105                                        } 
     106                                } 
     107 
     108                                foreach ($route as $key => $val) 
     109                                { 
     110                                        if ( ! is_string($key) OR $key === 'controller' OR $key === 'method' OR in_array($key, self::$readonly_keys)) 
     111                                        { 
     112                                                // These keys are not arguments, skip them 
     113                                                continue; 
     114                                        } 
     115 
     116                                        self::$arguments[$key] = $val; 
    106117                                } 
    107118 
     
    122133                                // A matching route has been found! 
    123134                                self::$current_route = $name; 
     135 
     136                                echo Kohana::debug($route, self::$arguments);exit; 
    124137 
    125138                                return TRUE;