summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorJonatas Miguel <jonatas.df.miguel@gmail.com>2012-09-27 12:39:33 +0200
committerJonatas Miguel <jonatas.df.miguel@gmail.com>2012-09-27 12:39:40 +0200
commitf950e5c18d7a36408e33cb11bb67a254362607cc (patch)
tree793a0b6331bacfebd3a305a462f4f59830fdee3c /system
parent8f1cdd1904d9f8da9e9cbd383e4385740cc6951b (diff)
made some corrections to the code
Diffstat (limited to 'system')
-rw-r--r--system/core/Router.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/system/core/Router.php b/system/core/Router.php
index 1d566c56f..0e915521d 100644
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -368,16 +368,13 @@ class CI_Router {
foreach ($this->routes as $key => $val)
{
// Convert wild-cards to RegEx
- $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));
+ $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);
// Does the RegEx match?
if (preg_match('#^'.$key.'$#', $uri, $matches))
{
- // Are we using a callback?
- $callable = ! is_string($val) && is_callable($val);
-
// Are we using callbacks to process back-references?
- if($callable)
+ if(! is_string($val) && is_callable($val))
{
// Remove the original string from the matches array.
array_shift($matches);
@@ -400,7 +397,7 @@ class CI_Router {
$val = call_user_func_array($val, $matches);
}
// Are we using the default routing method for back-references?
- else if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)
+ elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)
{
$val = preg_replace('#^'.$key.'$#', $val, $uri);
}