Make WordPress Core

Changeset 5091


Ignore:
Timestamp:
03/23/2007 02:57:19 AM (18 years ago)
Author:
ryan
Message:

Don't prepend protocol to relative links. fixes #4017 #4001 for 2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/wp-includes/formatting.php

    r5066 r5091  
    10731073    $url = str_replace($strip, '', $url);
    10741074    $url = str_replace(';//', '://', $url);
     1075    // Append http unless a relative link starting with / or a php file.
     1076    if ( strpos($url, '://') === false &&
     1077        substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9]+.php/i', $url) )
     1078        $url = 'http://' . $url;
     1079   
    10751080    $url = (strpos($url, '://') === false && substr( $url, 0, 1 ) != '/' ) ? 'http://'.$url : $url;
    10761081    $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
Note: See TracChangeset for help on using the changeset viewer.