Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Change route type checks priorities

  • Loading branch information...
commit 96ea52894aea85b86d75f59fee35f90676735060 1 parent e9d2dc8
Andrey Andreev narfbg authored

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. +6 6 system/core/Router.php
12 system/core/Router.php
@@ -341,8 +341,13 @@ protected function _parse_routes()
341 341 // Does the RegEx match?
342 342 if (preg_match('#^'.$key.'$#', $uri, $matches))
343 343 {
  344 + // Are we using the default routing method for back-references?
  345 + if (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)
  346 + {
  347 + $val = preg_replace('#^'.$key.'$#', $val, $uri);
  348 + }
344 349 // Are we using callbacks to process back-references?
345   - if ( ! is_string($val) && is_callable($val))
  350 + elseif ( ! is_string($val) && is_callable($val))
346 351 {
347 352 // Remove the original string from the matches array.
348 353 array_shift($matches);
@@ -379,11 +384,6 @@ protected function _parse_routes()
379 384 // Execute the callback using the values in matches as its parameters.
380 385 $val = call_user_func_array($val, $matches);
381 386 }
382   - // Are we using the default routing method for back-references?
383   - elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)
384   - {
385   - $val = preg_replace('#^'.$key.'$#', $val, $uri);
386   - }
387 387
388 388 return $this->_set_request(explode('/', $val));
389 389 }

0 comments on commit 96ea528

Please sign in to comment.
Something went wrong with that request. Please try again.