WordPress.org

Make WordPress Core

Ticket #6564: 6564.001.diff

File 6564.001.diff, 816 bytes (added by markjaquith, 10 years ago)
  • wp-includes/functions.php

     
    977977
    978978
    979979function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) {
     980        static $increment = 0;
     981        $id = $name;
     982        if ( '_wpnonce' == $id ) {
     983                $increment++;
     984                if ( $increment > 1 )
     985                        $id .= $increment;
     986        }
    980987        $name = attribute_escape( $name );
    981         $nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />';
     988        $id   = attribute_escape( $id   );
     989        $nonce_field = '<input type="hidden" id="' . $id . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />';
    982990        if ( $echo )
    983991                echo $nonce_field;
    984992