Ticket #3986: clean_url-includes_a-l.diff

File clean_url-includes_a-l.diff, 5.1 kB (added by ryan, 2 years ago)

clean_url() for wp-includes A - L

  • link-template.php

    old new  
    503503} 
    504504 
    505505function next_posts($max_page = 0) { 
    506         echo attribute_escape(get_next_posts_page_link($max_page)); 
     506        echo clean_url(get_next_posts_page_link($max_page)); 
    507507} 
    508508 
    509509function next_posts_link($label='Next Page »', $max_page=0) { 
     
    533533} 
    534534 
    535535function previous_posts() { 
    536         echo attribute_escape(get_previous_posts_page_link()); 
     536        echo clean_url(get_previous_posts_page_link()); 
    537537} 
    538538 
    539539function previous_posts_link($label='« Previous Page') { 
  • general-template.php

    old new  
    297297function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') { 
    298298        $text = wptexturize($text); 
    299299        $title_text = attribute_escape($text); 
     300        $url = clean_url($url); 
    300301 
    301302        if ('link' == $format) 
    302303                return "\t<link rel='archives' title='$title_text' href='$url' />\n"; 
     
    985986                $link = str_replace('%#%', $current - 1, $link); 
    986987                if ( $add_args ) 
    987988                        $link = add_query_arg( $add_args, $link ); 
    988                 $page_links[] = "<a class='prev page-numbers' href='" . attribute_escape($link) . "'>$prev_text</a>"; 
     989                $page_links[] = "<a class='prev page-numbers' href='" . clean_url($link) . "'>$prev_text</a>"; 
    989990        endif; 
    990991        for ( $n = 1; $n <= $total; $n++ ) : 
    991992                if ( $n == $current ) : 
     
    997998                                $link = str_replace('%#%', $n, $link); 
    998999                                if ( $add_args ) 
    9991000                                        $link = add_query_arg( $add_args, $link ); 
    1000                                 $page_links[] = "<a class='page-numbers' href='" . attribute_escape($link) . "'>$n</a>"; 
     1001                                $page_links[] = "<a class='page-numbers' href='" . clean_url($link) . "'>$n</a>"; 
    10011002                                $dots = true; 
    10021003                        elseif ( $dots && !$show_all ) : 
    10031004                                $page_links[] = "<span class='page-numbers dots'>...</span>"; 
     
    10101011                $link = str_replace('%#%', $current + 1, $link); 
    10111012                if ( $add_args ) 
    10121013                        $link = add_query_arg( $add_args, $link ); 
    1013                 $page_links[] = "<a class='next page-numbers' href='" . attribute_escape($link) . "'>$next_text</a>"; 
     1014                $page_links[] = "<a class='next page-numbers' href='" . clean_url($link) . "'>$next_text</a>"; 
    10141015        endif; 
    10151016        switch ( $type ) : 
    10161017                case 'array' : 
  • comment.php

    old new  
    169169        if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) ) { 
    170170                $comment_author_url = apply_filters('pre_comment_author_url', $_COOKIE['comment_author_url_'.COOKIEHASH]); 
    171171                $comment_author_url = stripslashes($comment_author_url); 
    172                 $comment_author_url = attribute_escape($comment_author_url); 
     172                $comment_author_url = clean_url($comment_author_url); 
    173173                $_COOKIE['comment_author_url_'.COOKIEHASH] = $comment_author_url; 
    174174        } 
    175175} 
  • functions.php

    old new  
    12721272 
    12731273        $adminurl = get_option('siteurl') . '/wp-admin'; 
    12741274        if ( wp_get_referer() ) 
    1275                 $adminurl = attribute_escape(wp_get_referer()); 
     1275                $adminurl = clean_url(wp_get_referer()); 
    12761276 
    12771277        $title = __('WordPress Confirmation'); 
    12781278        // Remove extra layer of slashes. 
     
    12891289                $html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n"; 
    12901290                $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n"; 
    12911291        } else { 
    1292                 $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . attribute_escape(add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] )) . "'>" . __('Yes') . "</a></p>\n\t</div>\n"; 
     1292                $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . clean_url(add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] )) . "'>" . __('Yes') . "</a></p>\n\t</div>\n"; 
    12931293        } 
    12941294        $html .= "</body>\n</html>"; 
    12951295        wp_die($html, $title); 
  • bookmark-template.php

    old new  
    9696                        $output .= get_option('links_recently_updated_prepend'); 
    9797                $the_link = '#'; 
    9898                if ( !empty($row->link_url) ) 
    99                         $the_link = wp_specialchars($row->link_url); 
     99                        $the_link = clean_url($row->link_url); 
    100100                $rel = $row->link_rel; 
    101101                if ( '' != $rel ) 
    102102                        $rel = ' rel="' . $rel . '"'; 
     
    260260 
    261261                $the_link = '#'; 
    262262                if ( !empty($bookmark->link_url) ) 
    263                         $the_link = wp_specialchars($bookmark->link_url); 
     263                        $the_link = clean_url($bookmark->link_url); 
    264264 
    265265                $rel = $bookmark->link_rel; 
    266266                if ( '' != $rel )