From 3bec9d59f081789605b9b479de590e7cb3b7ea44 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Mon, 1 Mar 2010 22:13:41 +0000 Subject: [PATCH] BUGFIX: Only switch to a subsite that you have access to if you actually have access to a subsite. (from r89042) (from r96306) --- code/LeftAndMainSubsites.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/LeftAndMainSubsites.php b/code/LeftAndMainSubsites.php index a5aa827..7a20d3e 100644 --- a/code/LeftAndMainSubsites.php +++ b/code/LeftAndMainSubsites.php @@ -23,7 +23,7 @@ class LeftAndMainSubsites extends Extension { // Switch to a subsite that this user can actually access. $sites = Subsite::accessible_sites("CMS_ACCESS_{$this->owner->class}")->toDropdownMap(); - if(!isset($sites[Subsite::currentSubsiteID()])) { + if($sites && !isset($sites[Subsite::currentSubsiteID()])) { $siteIDs = array_keys($sites); Subsite::changeSubsite($siteIDs[0]); }