Explorar o código

Prevent double slashes in base_url when installed to document root

Fixes #274
Daniel Rudolf %!s(int64=9) %!d(string=hai) anos
pai
achega
f5006c036a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/Pico.php

+ 1 - 1
lib/Pico.php

@@ -1220,7 +1220,7 @@ class Pico
 
         $this->config['base_url'] =
             $protocol . "://" . $_SERVER['HTTP_HOST']
-            . dirname($_SERVER['SCRIPT_NAME']) . '/';
+            . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/';
 
         return $this->getConfig('base_url');
     }