Changeset 40710
- Timestamp:
- 05/16/2017 12:18:10 PM (8 years ago)
- Location:
- branches/4.2
- Files:
- 4 edited
- . (modified) (1 prop)
- src/wp-admin/customize.php (modified) (1 diff)
- src/wp-admin/js/customize-controls.js (modified) (1 diff)
- src/wp-includes/class-wp-customize-manager.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
branches/4.2
branches/4.2/src/wp-admin/customize.php
r37772 r40710 149 149 <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Customizer Options' ); ?>" tabindex="0"> 150 150 <span class="preview-notice"><?php 151 echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name' ) . '</strong>' );151 echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' ); 152 152 ?></span> 153 153 </div> branches/4.2/src/wp-admin/js/customize-controls.js
r32119 r40710 2704 2704 }); 2705 2705 2706 // Ensure preview nonce is included with every customized request, to allow post data to be read. 2707 $.ajaxPrefilter( function injectPreviewNonce( options ) { 2708 if ( ! /wp_customize=on/.test( options.data ) ) { 2709 return; 2710 } 2711 options.data += '&' + $.param({ 2712 customize_preview_nonce: api.settings.nonce.preview 2713 }); 2714 }); 2715 2706 2716 // Refresh the nonces if the preview sends updated nonces over. 2707 2717 api.previewer.bind( 'nonce', function( nonce ) { branches/4.2/src/wp-includes/class-wp-customize-manager.php
r32265 r40710 196 196 197 197 show_admin_bar( false ); 198 199 /* 200 * Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer 201 * application will inject the customize_preview_nonce query parameter into all Ajax requests. 202 * For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out 203 * a user when a valid nonce isn't present. 204 */ 205 $has_post_data_nonce = ( 206 check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false ) 207 || 208 check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false ) 209 || 210 check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false ) 211 ); 212 if ( ! $has_post_data_nonce ) { 213 unset( $_POST['customized'] ); 214 unset( $_REQUEST['customized'] ); 215 } 198 216 199 217 if ( ! current_user_can( 'customize' ) ) {
Note: See TracChangeset for help on using the changeset viewer.