Changeset 40712 for branches/4.0
- Timestamp:
- 05/16/2017 12:19:44 PM (9 years ago)
- Location:
- branches/4.0
- 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.0
-
branches/4.0/src/wp-admin/customize.php
r37775 r40712 142 142 } else { 143 143 /* translators: %s is the site/panel title in the Customize pane */ 144 echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name' ) . '</strong>' );144 echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' ); 145 145 } 146 146 ?></span> -
branches/4.0/src/wp-admin/js/customize-controls.js
r29451 r40712 1087 1087 }); 1088 1088 1089 // Ensure preview nonce is included with every customized request, to allow post data to be read. 1090 $.ajaxPrefilter( function injectPreviewNonce( options ) { 1091 if ( ! /wp_customize=on/.test( options.data ) ) { 1092 return; 1093 } 1094 options.data += '&' + $.param({ 1095 customize_preview_nonce: api.settings.nonce.preview 1096 }); 1097 }); 1098 1089 1099 // Refresh the nonces if the preview sends updated nonces over. 1090 1100 api.previewer.bind( 'nonce', function( nonce ) { -
branches/4.0/src/wp-includes/class-wp-customize-manager.php
r29488 r40712 166 166 167 167 $this->theme = wp_get_theme( isset( $_REQUEST['theme'] ) ? $_REQUEST['theme'] : null ); 168 169 /* 170 * Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer 171 * application will inject the customize_preview_nonce query parameter into all Ajax requests. 172 * For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out 173 * a user when a valid nonce isn't present. 174 */ 175 $has_post_data_nonce = ( 176 check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false ) 177 || 178 check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false ) 179 || 180 check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false ) 181 ); 182 if ( ! $has_post_data_nonce ) { 183 unset( $_POST['customized'] ); 184 unset( $_REQUEST['customized'] ); 185 } 168 186 169 187 if ( $this->is_theme_active() ) {
Note: See TracChangeset
for help on using the changeset viewer.