WordPress.org

Make WordPress Core

Changeset 5097


Ignore:
Timestamp:
03/23/07 23:33:19 (8 years ago)
Author:
ryan
Message:

Fix relative link mangling in clean_url. fixes #4017 for 2.1

File:
1 edited

Legend:

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

    r5067 r5097  
    10521052    $url = str_replace($strip, '', $url); 
    10531053    $url = str_replace(';//', '://', $url); 
    1054     $url = (strpos($url, '://') === false && substr( $url, 0, 1 ) != '/' ) ? 'http://'.$url : $url; 
     1054    // Append http unless a relative link starting with / or a php file. 
     1055    if ( strpos($url, '://') === false && 
     1056        substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9]+?\.php/i', $url) ) 
     1057        $url = 'http://' . $url; 
     1058     
    10551059    $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 
    10561060    if ( !is_array($protocols) ) 
Note: See TracChangeset for help on using the changeset viewer.