Make WordPress Core


Ignore:
Timestamp:
01/02/2007 09:22:41 PM (20 years ago)
Author:
ryan
Message:

Add kses protocol checking to clean_url. Props Andy. fixes #3515

File:
1 edited

Legend:

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

    r4656 r4672  
    212212        do_action('wp_set_comment_status', $comment_id, 'delete');
    213213        return true;
    214 }
    215 
    216 function clean_url( $url ) {
    217         if ('' == $url) return $url;
    218         $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $url);
    219         $strip = array('%0d', '%0a');
    220         $url = str_replace($strip, '', $url);
    221         $url = str_replace(';//', '://', $url);
    222         $url = (!strstr($url, '://')) ? 'http://'.$url : $url;
    223         $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
    224         return $url;
    225214}
    226215
Note: See TracChangeset for help on using the changeset viewer.