Skip to:
Content

bbPress.org

Changeset 1975


Ignore:
Timestamp:
03/01/2009 02:56:53 PM (17 years ago)
Author:
sambauers
Message:

Some updated nonce methods from WordPress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-includes/functions.bb-core.php

    r1971 r1975  
    10811081
    10821082function bb_nonce_url($actionurl, $action = -1) {
    1083     return add_query_arg( '_wpnonce', bb_create_nonce( $action ), $actionurl );
    1084 }
    1085 
    1086 function bb_nonce_field($action = -1, $name = "_wpnonce", $referer = true) {
    1087     $name = attribute_escape($name);
    1088     echo '<input type="hidden" name="' . $name . '" value="' . bb_create_nonce($action) . '" />';
     1083    $actionurl = str_replace( '&amp;', '&', $actionurl );
     1084    return wp_specialchars( add_query_arg( '_wpnonce', bb_create_nonce( $action ), $actionurl ) );
     1085}
     1086
     1087function bb_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) {
     1088    $name = attribute_escape( $name );
     1089    $nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . bb_create_nonce( $action ) . '" />';
     1090    if ( $echo )
     1091        echo $nonce_field;
     1092
    10891093    if ( $referer )
    1090         wp_referer_field();
     1094        wp_referer_field( $echo, 'previous' );
     1095
     1096    return $nonce_field;
    10911097}
    10921098
Note: See TracChangeset for help on using the changeset viewer.