WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/14/2008 10:58:30 PM (13 years ago)
Author:
matt
Message:

clean_url improvements, Hat tip: markjaquith. Reviewed by nbachiyskip. Fixes #7386.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r9137 r9179  
    16711671
    16721672    if ('' == $url) return $url;
    1673     $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@()\\x80-\\xff]|i', '', $url);
     1673    $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$*\'()\\x80-\\xff]|i', '', $url);
    16741674    $strip = array('%0d', '%0a');
    16751675    $url = str_replace($strip, '', $url);
     
    16831683        $url = 'http://' . $url;
    16841684
    1685     // Replace ampersands only when displaying.
    1686     if ( 'display' == $context )
     1685    // Replace ampersands and single quotes only when displaying.
     1686    if ( 'display' == $context ) {
    16871687        $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
     1688        $url = str_replace( "'", ''', $url );
     1689    }
    16881690
    16891691    if ( !is_array($protocols) )
Note: See TracChangeset for help on using the changeset viewer.