Changeset 37145 for trunk/src/wp-admin/theme-install.php
- Timestamp:
- 03/30/2016 06:35:37 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/theme-install.php
r36858 r37145 157 157 <div class="favorites-form"> 158 158 <?php 159 $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); 160 update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); 159 $action = 'save_wporg_username_' . get_current_user_id(); 160 if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) { 161 $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); 162 update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); 163 } else { 164 $user = get_user_option( 'wporg_favorites' ); 165 } 161 166 ?> 162 167 <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p> … … 164 169 <p> 165 170 <label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label> 171 <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" /> 166 172 <input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" /> 167 173 <input type="button" class="button button-secondary favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
Note: See TracChangeset
for help on using the changeset viewer.