Make WordPress Core


Ignore:
Timestamp:
12/21/2006 10:10:04 AM (20 years ago)
Author:
markjaquith
Message:

new function for escaping within attributes: attribute_escape()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r4636 r4656  
    280280function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
    281281        $text = wptexturize($text);
    282         $title_text = wp_specialchars($text, 1);
     282        $title_text = attribute_escape($text);
    283283
    284284        if ('link' == $format)
    … …  
    902902function the_search_query() {
    903903        global $s;
    904         echo wp_specialchars( stripslashes($s), 1 );
     904        echo attribute_escape( stripslashes($s));
    905905}
    906906
    … …  
    957957                if ( $add_args )
    958958                        $link = add_query_arg( $add_args, $link );
    959                 $page_links[] = "<a class='prev page-numbers' href='" . wp_specialchars( $link, 1 ) . "'>$prev_text</a>";
     959                $page_links[] = "<a class='prev page-numbers' href='" . attribute_escape( $link) . "'>$prev_text</a>";
    960960        endif;
    961961        for ( $n = 1; $n <= $total; $n++ ) :
    … …  
    969969                                if ( $add_args )
    970970                                        $link = add_query_arg( $add_args, $link );
    971                                 $page_links[] = "<a class='page-numbers' href='" . wp_specialchars( $link, 1 ) . "'>$n</a>";
     971                                $page_links[] = "<a class='page-numbers' href='" . attribute_escape( $link) . "'>$n</a>";
    972972                                $dots = true;
    973973                        elseif ( $dots && !$show_all ) :
    … …  
    982982                if ( $add_args )
    983983                        $link = add_query_arg( $add_args, $link );
    984                 $page_links[] = "<a class='next page-numbers' href='" . wp_specialchars( $link, 1 ) . "'>$next_text</a>";
     984                $page_links[] = "<a class='next page-numbers' href='" . attribute_escape( $link) . "'>$next_text</a>";
    985985        endif;
    986986        switch ( $type ) :
Note: See TracChangeset for help on using the changeset viewer.