Make WordPress Core

Ticket #24063: 24063.patch

File 24063.patch, 1.6 KB (added by johnbillion, 12 years ago)
  • wp-includes/functions.php

     
    11741174 * @return string URL with nonce action added.
    11751175 */
    11761176function wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' ) {
     1177        if ( -1 == $action )
     1178                _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action as the second parameter.' ), '3.6' );
     1179
    11771180        $actionurl = str_replace( '&', '&', $actionurl );
    11781181        return esc_html( add_query_arg( $name, wp_create_nonce( $action ), $actionurl ) );
    11791182}
     
    12071210 * @return string Nonce field.
    12081211 */
    12091212function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) {
     1213        if ( -1 == $action )
     1214                _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action as the first parameter.' ), '3.6' );
     1215
    12101216        $name = esc_attr( $name );
    12111217        $nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />';
    12121218
  • wp-includes/pluggable.php

     
    829829 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
    830830 */
    831831function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
     832        if ( -1 == $action )
     833                _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.6' );
     834
    832835        if ( $query_arg )
    833836                $nonce = $_REQUEST[$query_arg];
    834837        else