Minor fix to relative urls

This commit is contained in:
Scott Walkinshaw
2011-06-09 08:17:14 -06:00
parent acea241631
commit cd87358195

View File

@@ -78,7 +78,7 @@ add_filter('get_search_query', 'roots_search_query');
function roots_root_relative_url($input) {
preg_match('/(https?:\/\/[^\/|"]+)/', $input, $matches);
// make sure we aren't making external links relative
if (strpos($matches[0], site_url()) === false) {
if (isset($matches[0]) && strpos($matches[0], site_url()) === false) {
return $input;
} else {
return str_replace(end($matches), '', $input);