diff --git a/laravel/bundle.php b/laravel/bundle.php index 8641c98c..024c3fa5 100644 --- a/laravel/bundle.php +++ b/laravel/bundle.php @@ -52,6 +52,14 @@ public static function register($bundle, $config = array()) // to the location path for the bundle. $config['location'] = path('bundle').rtrim($config['location'], DS).DS; + // If the handles clause is set, we will append a trailing slash so + // that it is not ultra-greedy. Otherwise, bundles that handle "s" + // would handle all bundles that start with "s". + if (isset($config['handles'])) + { + $config['handles'] = $config['handles'].'/'; + } + static::$bundles[$bundle] = array_merge($defaults, $config); } @@ -115,6 +123,8 @@ public static function routes($bundle) */ public static function handles($uri) { + $uri = rtrim($uri, '/').'/'; + foreach (static::$bundles as $key => $value) { if (starts_with($uri, $value['handles'])) return $key;