mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
9cc825e769
commit
deb533238c
@ -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")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user