Make WordPress Core


Ignore:
Timestamp:
03/17/2007 08:47:29 AM (19 years ago)
Author:
markjaquith
Message:

use clean_url() instead of attribute_escape() when dealing with src/href to protect against XSS. props xknown. fixes #3986 for 2.1.

File:
1 edited

Legend:

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

    r5027 r5057  
    290290    $text = wptexturize($text);
    291291    $title_text = attribute_escape($text);
     292    $url = clean_url($url);
    292293
    293294    if ('link' == $format)
     
    972973        if ( $add_args )
    973974            $link = add_query_arg( $add_args, $link );
    974         $page_links[] = "<a class='prev page-numbers' href='" . attribute_escape($link) . "'>$prev_text</a>";
     975        $page_links[] = "<a class='prev page-numbers' href='" . clean_url($link) . "'>$prev_text</a>";
    975976    endif;
    976977    for ( $n = 1; $n <= $total; $n++ ) :
     
    984985                if ( $add_args )
    985986                    $link = add_query_arg( $add_args, $link );
    986                 $page_links[] = "<a class='page-numbers' href='" . attribute_escape($link) . "'>$n</a>";
     987                $page_links[] = "<a class='page-numbers' href='" . clean_url($link) . "'>$n</a>";
    987988                $dots = true;
    988989            elseif ( $dots && !$show_all ) :
     
    997998        if ( $add_args )
    998999            $link = add_query_arg( $add_args, $link );
    999         $page_links[] = "<a class='next page-numbers' href='" . attribute_escape($link) . "'>$next_text</a>";
     1000        $page_links[] = "<a class='next page-numbers' href='" . clean_url($link) . "'>$next_text</a>";
    10001001    endif;
    10011002    switch ( $type ) :
Note: See TracChangeset for help on using the changeset viewer.