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/functions.php

    r4643 r4656  
    232232
    233233function form_option($option) {
    234         echo wp_specialchars( get_option($option), 1 );
     234        echo attribute_escape( get_option($option));
    235235}
    236236
    … …  
    915915
    916916function wp_referer_field() {
    917         $ref = wp_specialchars($_SERVER['REQUEST_URI']);
     917        $ref = attribute_escape($_SERVER['REQUEST_URI']);
    918918        echo '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />';
    919919        if ( wp_get_original_referer() ) {
    920                 $original_ref = wp_specialchars(stripslashes(wp_get_original_referer()));
     920                $original_ref = attribute_escape(stripslashes(wp_get_original_referer()));
    921921                echo '<input type="hidden" name="_wp_original_http_referer" value="'. $original_ref . '" />';
    922922        }
    … …  
    924924
    925925function wp_original_referer_field() {
    926         echo '<input type="hidden" name="_wp_original_http_referer" value="' . wp_specialchars(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
     926        echo '<input type="hidden" name="_wp_original_http_referer" value="' . attribute_escape(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
    927927}
    928928
    … …  
    11911191                        $v = substr(strstr($a, '='), 1);
    11921192                        $k = substr($a, 0, -(strlen($v)+1));
    1193                         $html .= "\t\t<input type='hidden' name='" . wp_specialchars( urldecode($k), 1 ) . "' value='" . wp_specialchars( urldecode($v), 1 ) . "' />\n";
     1193                        $html .= "\t\t<input type='hidden' name='" . attribute_escape( urldecode($k)) . "' value='" . attribute_escape( urldecode($v)) . "' />\n";
    11941194                }
    11951195                $html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n";
Note: See TracChangeset for help on using the changeset viewer.