Avoid string offset notices in [25319].
git-svn-id: https://develop.svn.wordpress.org/trunk@25340 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3b314a0adf
commit
760e9e02d1
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user