Skip to content
Browse files

Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into …

…develop
  • Loading branch information...
2 parents 1553444 + e2b0754 commit 641aeffd33a648ca657eec7e47545cd6c692c676 @it-can committed Nov 8, 2012
View
14 system/core/Router.php
@@ -327,7 +327,7 @@ protected function _parse_routes()
$uri = implode('/', $this->uri->segments);
// Is there a literal match? If so we're done
- if (isset($this->routes[$uri]))
+ if (isset($this->routes[$uri]) && is_string($this->routes[$uri]))
{
return $this->_set_request(explode('/', $this->routes[$uri]));
}
@@ -341,13 +341,8 @@ protected function _parse_routes()
// 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 @@ protected function _parse_routes()
// 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));
}
View
4 system/database/drivers/mysql/mysql_forge.php
@@ -118,10 +118,10 @@ protected function _alter_table($alter_type, $table, $field)
}
else
{
- $field[$i]['_literal'] = empty($field['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE ";
+ $field[$i]['_literal'] = empty($field[$i]['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE ";
}
- $field[$i] = $field['_literal'].$this->_process_column($field[$i]);
+ $field[$i] = $field[$i]['_literal'].$this->_process_column($field[$i]);
}
}
View
4 system/database/drivers/mysqli/mysqli_forge.php
@@ -118,10 +118,10 @@ protected function _alter_table($alter_type, $table, $field)
}
else
{
- $field[$i]['_literal'] = empty($field['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE ";
+ $field[$i]['_literal'] = empty($field[$i]['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE ";
}
- $field[$i] = $field['_literal'].$this->_process_column($field[$i]);
+ $field[$i] = $field[$i]['_literal'].$this->_process_column($field[$i]);
}
}
View
4 system/database/drivers/pdo/subdrivers/pdo_mysql_forge.php
@@ -132,10 +132,10 @@ protected function _alter_table($alter_type, $table, $field)
}
else
{
- $field[$i]['_literal'] = empty($field['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE ";
+ $field[$i]['_literal'] = empty($field[$i]['new_name']) ? "\n\tMODIFY " : "\n\tCHANGE ";
}
- $field[$i] = $field['_literal'].$this->_process_column($field[$i]);
+ $field[$i] = $field[$i]['_literal'].$this->_process_column($field[$i]);
}
}

0 comments on commit 641aeff

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