Make WordPress Core


Ignore:
Timestamp:
03/14/2007 11:12:47 PM (19 years ago)
Author:
markjaquith
Message:

nonce-protect comments by users with unfiltered_html cap to prevent xsrf/xss. fixes #3973 for 2.1

File:
1 edited

Legend:

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

    r4952 r5040  
    921921}
    922922
    923 function wp_nonce_field($action = -1) {
    924     echo '<input type="hidden" name="_wpnonce" value="' . wp_create_nonce($action) . '" />';
    925     wp_referer_field();
     923function wp_nonce_field($action = -1, $name = "_wpnonce", $referer = true) {
     924    $name = attribute_escape($name);
     925    echo '<input type="hidden" name="' . $name . '" value="' . wp_create_nonce($action) . '" />';
     926    if ( $referer )
     927        wp_referer_field();
    926928}
    927929
Note: See TracChangeset for help on using the changeset viewer.