Skip to content

Commit

Permalink
Fixed pathing problems on non-windows systems, closes #50.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Chernyshev committed Jul 31, 2011
1 parent fe801a7 commit e9d0340
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion global.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
# function to generate URL from current showslow_root
function getShowSlowBase() {
global $showslow_root;
$showslow_root = str_replace(DIRECTORY_SEPARATOR, '/', $showslow_root);

// Chopping of trailing slash which is not supposed to be there in Apache config
// See: http://httpd.apache.org/docs/2.0/mod/core.html#documentroot
$docroot = $_SERVER['DOCUMENT_ROOT'];
$docroot = str_replace(DIRECTORY_SEPARATOR, '/', $_SERVER['DOCUMENT_ROOT']);
if (substr($docroot, -1) == '/') {
$docroot = substr($docroot, 0, -1);
}
Expand Down

0 comments on commit e9d0340

Please sign in to comment.