Skip to:
Content

bbPress.org

Changeset 2791


Ignore:
Timestamp:
01/11/2011 07:50:36 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Backport clean_url fixes to 0.9 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9/bb-includes/wp-functions.php

    r2381 r2791  
    1313    $original_url = $url;
    1414
    15     if ('' == $url) return $url;
     15    if ( '' == $url )
     16        return $url;
    1617    $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
    1718    $strip = array('%0d', '%0a', '%0D', '%0A');
     
    2829    // Replace ampersands and single quotes only when displaying.
    2930    if ( 'display' == $context ) {
    30         $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
     31        $url = wp_kses_normalize_entities( $url );
     32        $url = str_replace( '&', '&', $url );
    3133        $url = str_replace( "'", ''', $url );
    3234    }
    3335
    3436    if ( !is_array($protocols) )
    35         $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
     37        $protocols = array ('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');
    3638    if ( wp_kses_bad_protocol( $url, $protocols ) != $url )
    3739        return '';
Note: See TracChangeset for help on using the changeset viewer.