Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/04/2013 04:42:44 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Add $filter parameter and supporting phpdoc to bbp_displayed_user_field() && bbp_get_displayed_user_field() to allow more accurate sanitization of displayed user field values. Remove superfluous isset() check. Use 'edit' parameter in form-user-edit.php. See #1999.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/default/bbpress/form-user-edit.php

    r4956 r4979  
    2323                <div>
    2424                        <label for="first_name"><?php _e( 'First Name', 'bbpress' ) ?></label>
    25                         <input type="text" name="first_name" id="first_name" value="<?php bbp_displayed_user_field( 'first_name' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
     25                        <input type="text" name="first_name" id="first_name" value="<?php bbp_displayed_user_field( 'first_name', 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
    2626                </div>
    2727
    2828                <div>
    2929                        <label for="last_name"><?php _e( 'Last Name', 'bbpress' ) ?></label>
    30                         <input type="text" name="last_name" id="last_name" value="<?php bbp_displayed_user_field( 'last_name' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
     30                        <input type="text" name="last_name" id="last_name" value="<?php bbp_displayed_user_field( 'last_name', 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
    3131                </div>
    3232
    3333                <div>
    3434                        <label for="nickname"><?php _e( 'Nickname', 'bbpress' ); ?></label>
    35                         <input type="text" name="nickname" id="nickname" value="<?php bbp_displayed_user_field( 'nickname' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
     35                        <input type="text" name="nickname" id="nickname" value="<?php bbp_displayed_user_field( 'nickname', 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
    3636                </div>
    3737
     
    5656                <div>
    5757                        <label for="url"><?php _e( 'Website', 'bbpress' ) ?></label>
    58                         <input type="text" name="url" id="url" value="<?php bbp_displayed_user_field( 'user_url' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
     58                        <input type="text" name="url" id="url" value="<?php bbp_displayed_user_field( 'user_url', 'edit' ); ?>" class="regular-text code" tabindex="<?php bbp_tab_index(); ?>" />
    5959                </div>
    6060
     
    8181                <div>
    8282                        <label for="description"><?php _e( 'Biographical Info', 'bbpress' ); ?></label>
    83                         <textarea name="description" id="description" rows="5" cols="30" tabindex="<?php bbp_tab_index(); ?>"><?php echo esc_attr( bbp_get_displayed_user_field( 'description' ) ); ?></textarea>
     83                        <textarea name="description" id="description" rows="5" cols="30" tabindex="<?php bbp_tab_index(); ?>"><?php echo bbp_get_displayed_user_field( 'stuff', 'edit' ); ?></textarea>
    8484                </div>
    8585
     
    9797                <div>
    9898                        <label for="user_login"><?php _e( 'Username', 'bbpress' ); ?></label>
    99                         <input type="text" name="user_login" id="user_login" value="<?php bbp_displayed_user_field( 'user_login' ); ?>" disabled="disabled" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
     99                        <input type="text" name="user_login" id="user_login" value="<?php bbp_displayed_user_field( 'user_login', 'edit' ); ?>" disabled="disabled" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
    100100                </div>
    101101
     
    103103                        <label for="email"><?php _e( 'Email', 'bbpress' ); ?></label>
    104104
    105                         <input type="text" name="email" id="email" value="<?php bbp_displayed_user_field( 'user_email' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
     105                        <input type="text" name="email" id="email" value="<?php bbp_displayed_user_field( 'user_email', 'edit' ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
    106106
    107107                        <?php
     
    109109                        // Handle address change requests
    110110                        $new_email = get_option( bbp_get_displayed_user_id() . '_new_email' );
    111                         if ( $new_email && $new_email != bbp_get_displayed_user_field( 'user_email' ) ) : ?>
     111                        if ( $new_email && $new_email != bbp_get_displayed_user_field( 'user_email', 'edit' ) ) : ?>
    112112
    113113                                <span class="updated inline">
Note: See TracChangeset for help on using the changeset viewer.