mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
fixing preg error in Router::normalize cause by last commit
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7984 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
6c243e1106
commit
6026e75009
2 changed files with 7 additions and 1 deletions
|
@ -1179,7 +1179,7 @@ class Router extends Object {
|
|||
$paths = Router::getPaths();
|
||||
|
||||
if (!empty($paths['base']) && stristr($url, $paths['base'])) {
|
||||
$url = preg_replace("/{$paths['base']}/", '', $url, 1);
|
||||
$url = preg_replace('/' . preg_quote($paths['base'], '/') . '/', '', $url, 1);
|
||||
}
|
||||
$url = '/' . $url;
|
||||
|
||||
|
|
|
@ -271,6 +271,12 @@ class RouterTest extends CakeTestCase {
|
|||
$result = Router::normalize('/us/users/logout/');
|
||||
$this->assertEqual($result, '/users/logout');
|
||||
|
||||
Router::reload();
|
||||
|
||||
Router::setRequestInfo(array(array(), array('base' => '/cake_12')));
|
||||
$result = Router::normalize('/cake_12/users/logout/');
|
||||
$this->assertEqual($result, '/users/logout');
|
||||
|
||||
}
|
||||
/**
|
||||
* testUrlGeneration method
|
||||
|
|
Loading…
Add table
Reference in a new issue