mirror of
https://github.com/e107inc/e107.git
synced 2025-08-10 00:27:45 +02:00
Issue #3912 Fix for partial route match. Partials should always end with a '/' for predictable results.
This commit is contained in:
@@ -572,7 +572,7 @@ class e_theme
|
||||
foreach($cusPageArray as $kpage)
|
||||
{
|
||||
// e_ROUTE
|
||||
if(!empty($request['route']) && (strpos($kpage,':'.$request['route']) === 0))
|
||||
if(!empty($request['route']) && (strpos(':'.$request['route'], $kpage) === 0))
|
||||
{
|
||||
return $lyout;
|
||||
}
|
||||
|
@@ -453,6 +453,7 @@
|
||||
0 => 'forum',
|
||||
1 => 'user.php!', // <-- exact match of URL
|
||||
2 => ':forum/index',
|
||||
3 => ':myplugin/',
|
||||
|
||||
// 2 => '/user', // <-- Expecting URL to match both user and usersetting since it contains no "!"
|
||||
),
|
||||
@@ -512,6 +513,7 @@
|
||||
// Using e_ROUTE;
|
||||
24 => array('url' => 'whatever.php', 'script'=>'whatever.php', 'route'=> 'news/view/index', 'expected'=> 'other_layout'),
|
||||
25 => array('url' => 'whatever.php', 'script'=>'whatever.php', 'route'=> 'forum/index', 'expected'=> 'jumbotron_full'),
|
||||
26 => array('url' => 'whatever.php', 'script'=>'whatever.php', 'route'=> 'myplugin/index', 'expected'=> 'jumbotron_full'),
|
||||
|
||||
);
|
||||
|
||||
@@ -522,7 +524,8 @@
|
||||
$var['script'] = isset($var['script']) ? $var['script'] : null;
|
||||
|
||||
$result = $themeObj::getThemeLayout($pref, $defaultLayout, $var);
|
||||
$this->assertEquals($var['expected'],$result, "Wrong theme layout returned for item [".$item."] ".$var['url']);
|
||||
$diz = isset($var['route']) ? $var['route'] : $var['url'];
|
||||
$this->assertEquals($var['expected'],$result, "Wrong theme layout returned for item [".$item."] ".$diz);
|
||||
// echo $var['url']."\t\t\t".$result."\n\n";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user