From 830ab78a45835533d9479a8b72d4c7ed01e6224f Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Fri, 30 Dec 2011 13:11:46 +0000 Subject: [PATCH] Fix base_uri calculation when using site root --- source/lib/SihnonFramework/Main.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/lib/SihnonFramework/Main.class.php b/source/lib/SihnonFramework/Main.class.php index ba0062e..1a17a0f 100644 --- a/source/lib/SihnonFramework/Main.class.php +++ b/source/lib/SihnonFramework/Main.class.php @@ -23,7 +23,8 @@ class SihnonFramework_Main { protected $base_uri; protected function __construct() { - $this->base_uri = dirname($_SERVER['SCRIPT_NAME']) . '/'; + $dirname = dirname($_SERVER['SCRIPT_NAME']); + $this->base_uri = $dirname == '/' ? '/' : $dirname . '/'; } protected function init() {