summaryrefslogtreecommitdiffstats
path: root/system/core/Router.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-08 10:34:00 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-08 10:34:00 +0100
commit96ea52894aea85b86d75f59fee35f90676735060 (patch)
treeb3de5df0ddeb03d6b1645ffaac476c955c82d7b4 /system/core/Router.php
parente9d2dc85b9cb255aae235635576972e4b7dbd5a8 (diff)
Change route type checks priorities
Diffstat (limited to 'system/core/Router.php')
-rw-r--r--system/core/Router.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/system/core/Router.php b/system/core/Router.php
index 30bf39657..3ef55cee2 100644
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -341,8 +341,13 @@ class CI_Router {
// Does the RegEx match?
if (preg_match('#^'.$key.'$#', $uri, $matches))
{
+ // Are we using the default routing method for back-references?
+ if (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)
+ {
+ $val = preg_replace('#^'.$key.'$#', $val, $uri);
+ }
// Are we using callbacks to process back-references?
- if ( ! is_string($val) && is_callable($val))
+ elseif ( ! is_string($val) && is_callable($val))
{
// Remove the original string from the matches array.
array_shift($matches);
@@ -379,11 +384,6 @@ class CI_Router {
// Execute the callback using the values in matches as its parameters.
$val = call_user_func_array($val, $matches);
}
- // Are we using the default routing method for back-references?
- elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)
- {
- $val = preg_replace('#^'.$key.'$#', $val, $uri);
- }
return $this->_set_request(explode('/', $val));
}