BUGFIX: Generate stage/live links using Controller::join_links() instead of string concatenation. (from r104581)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112353 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-10-15 00:29:53 +00:00
parent 9cc825e769
commit deb533238c
2 changed files with 7 additions and 7 deletions

View File

@ -118,7 +118,7 @@ class ContentController extends Controller {
Session::clear('currentStage');
Session::clear('archiveDate');
return Security::permissionFailure($this, sprintf($message, "$link?stage=Live"));
return Security::permissionFailure($this, sprintf($message, Controller::join_links($link, "?stage=Live")));
}
}

View File

@ -96,8 +96,8 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
} else {
$draftPage = Versioned::get_one_by_stage('SiteTree', 'Stage', '"SiteTree"."ID" = ' . $page->ID);
if($draftPage) {
$pageLink = $draftPage->AbsoluteLink();
return "<a href=\"$pageLink?stage=Stage\" class=\"newWindow\" target=\"site\" style=\"left : -1px;\">". _t('ContentController.DRAFTSITE', 'Draft Site') ."</a>";
$pageLink = Controller::join_links($draftPage->AbsoluteLink(), "?stage=Stage");
return "<a href=\"$pageLink\" class=\"newWindow\" target=\"site\" style=\"left : -1px;\">". _t('ContentController.DRAFTSITE', 'Draft Site') ."</a>";
}
}
}
@ -110,7 +110,7 @@ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem {
function getLink($page) {
if(Versioned::current_stage() == 'Stage') {
return $page->AbsoluteLink() . '?stage=Stage';
return Controller::join_links($page->AbsoluteLink(), '?stage=Stage');
}
}
}
@ -128,8 +128,8 @@ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
} else {
$livePage = Versioned::get_one_by_stage('SiteTree', 'Live', '"SiteTree"."ID" = ' . $page->ID);
if($livePage) {
$pageLink = $livePage->AbsoluteLink();
return "<a href=\"$pageLink?stage=Live\" class=\"newWindow\" target=\"site\" style=\"left : -3px;\">". _t('ContentController.PUBLISHEDSITE', 'Published Site') ."</a>";
$pageLink = Controller::join_links($livePage->AbsoluteLink(), "?stage=Live");
return "<a href=\"$pageLink\" class=\"newWindow\" target=\"site\" style=\"left : -3px;\">". _t('ContentController.PUBLISHEDSITE', 'Published Site') ."</a>";
}
}
}
@ -142,7 +142,7 @@ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
function getLink($page) {
if(Versioned::current_stage() == 'Live') {
return $page->AbsoluteLink() . '?stage=Live';
return Controller::join_links($page->AbsoluteLink(), '?stage=Live');
}
}
}