BUGFIX: Fixed bug with // placement in CMSMenu Director rule generation

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65502 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-11-10 01:01:09 +00:00
parent 6f33a5fcf6
commit 3546ec275b

View File

@ -33,9 +33,18 @@ class CMSMenu extends Object implements Iterator
*/
public static function add_controller($controllerClass) {
$controller = singleton($controllerClass);
Director::addRules($controller->stat('url_priority', true),
array(Controller::join_links($controller->Link(), $controller->stat('url_rule', true)) => $controllerClass)
);
$link = $controller->Link();
if(substr($link,-1) == '/') $link = substr($link,0,-1);
$subRule = $controller->stat('url_rule', true);
if($subRule[0] == '/') $subRule = substr($subRule,1);
$rule = $link . '//' . $subRule;
Director::addRules($controller->stat('url_priority', true), array(
$rule => $controllerClass
));
return self::add_menu_item(
$controllerClass,
$controller->getMenuTitle(),