r1257 + fixed annoying double-slash in generated URLs (hopefully)
authorDenis Ovsienko <infrastation@yandex.ru>
Fri, 9 Nov 2007 23:21:55 +0000 (23:21 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Fri, 9 Nov 2007 23:21:55 +0000 (23:21 +0000)
inc/init.php

index 64d0c251720ec1efa512bd942aa0de1f1154a2ae..d385a3036ab77be5b69c1223dc23b80949c99d34 100644 (file)
@@ -11,7 +11,9 @@
 $root = (empty($_SERVER['HTTPS'])?'http':'https').
        '://'.
        (isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:($_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']=='80'?'':$_SERVER['SERVER_PORT']))).
-       dirname($_SERVER['PHP_SELF']).'/';
+       dirname($_SERVER['PHP_SELF']);
+if (substr ($root, -1) != '/')
+       $root .= '/';
 
 // This is the first thing we need to do.
 require_once 'inc/config.php';