Fix (hack) for subdir installs

This commit is contained in:
Damian Regan
2013-02-21 19:39:36 +00:00
parent 78031a9ffe
commit ec87eabbaf

View File

@@ -142,6 +142,13 @@ function roots_root_relative_url($input) {
),
$input
);
// detect and correct for subdir installs
if($subdir = parse_url(home_url(), PHP_URL_PATH)) {
if(substr($output, 0, strlen($subdir)) == (substr($output, strlen($subdir), strlen($subdir)))) {
$output = substr($output, strlen($subdir));
}
}
return $output;
}