From 30b5134b8022e3d486bf9657a36f939719298cc4 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Fri, 29 Oct 2010 02:24:58 +0000 Subject: [PATCH] BUGFIX: use sapphire as the default location. BUGFIX: fixed index templates being thrown as 404 --- code/DocumentationViewer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/DocumentationViewer.php b/code/DocumentationViewer.php index ad22a74..0eaf3a7 100755 --- a/code/DocumentationViewer.php +++ b/code/DocumentationViewer.php @@ -102,7 +102,6 @@ class DocumentationViewer extends Controller { * @return SS_HTTPResponse */ public function handleRequest(SS_HTTPRequest $request) { - // if we submitted a form, let that pass if(!$request->isGET()) return parent::handleRequest($request); @@ -111,7 +110,7 @@ class DocumentationViewer extends Controller { $thirdParam = $request->shift(); $this->Remaining = $request->shift(10); - + DocumentationService::load_automatic_registration(); if(isset($firstParam)) { @@ -146,7 +145,7 @@ class DocumentationViewer extends Controller { // 'current' version mapping $module = DocumentationService::is_registered_module($this->module, null, $this->getLang()); - + if($module && $this->getVersion()) { $current = $module->getCurrentVersion(); @@ -158,6 +157,7 @@ class DocumentationViewer extends Controller { $this->version = 'current'; $link = $this->Link($this->Remaining); $this->response = new SS_HTTPResponse(); + $this->redirect($link, 301); // permanent redirect return $this->response; @@ -392,7 +392,7 @@ class DocumentationViewer extends Controller { $linkParts = array(); // don't include the 'index in the url - if($page->Title != "Index") $linkParts[] = $page->Filename; + if(strtolower($page->Title) != "index") $linkParts[] = $page->Filename; $page->Link = $this->Link($linkParts); $page->LinkingMode = 'link';