From ec87eabbaf385bb2f98c4e92739f4ea6d48517ed Mon Sep 17 00:00:00 2001 From: Damian Regan Date: Thu, 21 Feb 2013 19:39:36 +0000 Subject: [PATCH] Fix (hack) for subdir installs --- lib/cleanup.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/cleanup.php b/lib/cleanup.php index a9f17c4..7c49a0d 100644 --- a/lib/cleanup.php +++ b/lib/cleanup.php @@ -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; }