From da5562a4bd87ad8ea827298dbe60e850225cfe34 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 8 Nov 2012 12:34:38 +0200 Subject: Revert 96ea52894aea85b86d75f59fee35f90676735060 --- system/core/Router.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/core/Router.php b/system/core/Router.php index 3ef55cee2..30bf39657 100644 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -341,13 +341,8 @@ 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? - elseif ( ! is_string($val) && is_callable($val)) + if ( ! is_string($val) && is_callable($val)) { // Remove the original string from the matches array. array_shift($matches); @@ -384,6 +379,11 @@ 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)); } -- cgit v1.2.3-24-g4f1b