From b302f84b496d4f0c7f80cb631f7a75b299708db5 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 11 Sep 2013 03:57:09 +0000 Subject: [PATCH] Avoid string offset notices in [25319]. Built from https://develop.svn.wordpress.org/trunk@25340 git-svn-id: http://core.svn.wordpress.org/trunk@25302 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index a6fbf3b9b1..4264d784ef 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -2293,12 +2293,12 @@ function set_url_scheme( $url, $scheme = null ) { } $url = trim( $url ); - if ( $url[0] === '/' && $url[1] === '/' ) + if ( substr( $url, 0, 2 ) === '//' ) $url = 'http:' . $url; if ( 'relative' == $scheme ) { $url = ltrim( preg_replace( '#^\w+://[^/]*#', '', $url ) ); - if ( $url[0] === '/' ) + if ( $url !== '' && $url[0] === '/' ) $url = '/' . ltrim($url , "/ \t\n\r\0\x0B" ); } else { $url = preg_replace( '#^\w+://#', $scheme . '://', $url );