From 3a9077c074bdc1d2d757cc2efa971d11ac207572 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Tue, 10 Apr 2012 21:30:23 -0600 Subject: [PATCH] Fix #392 - Small tweak to root relative cleanup --- inc/roots-cleanup.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inc/roots-cleanup.php b/inc/roots-cleanup.php index 7025d26..f6bcf7e 100644 --- a/inc/roots-cleanup.php +++ b/inc/roots-cleanup.php @@ -40,11 +40,11 @@ function roots_root_relative_url($input) { '!(https?://[^/|"]+)([^"]+)?!', create_function( '$matches', - // if full URL is site_url, return a slash for relative root - 'if (isset($matches[0]) && $matches[0] === site_url()) { return "/";' . - // if domain is equal to site_url, then make URL relative - '} elseif (isset($matches[0]) && strpos($matches[0], site_url()) !== false) { return $matches[2];' . - // if domain is not equal to site_url, do not make external link relative + // if full URL is home_url("/"), return a slash for relative root + 'if (isset($matches[0]) && $matches[0] === home_url("/")) { return "/";' . + // if domain is equal to home_url("/"), then make URL relative + '} elseif (isset($matches[0]) && strpos($matches[0], home_url("/")) !== false) { return $matches[2];' . + // if domain is not equal to home_url("/"), do not make external link relative '} else { return $matches[0]; };' ), $input