Changeset 49409 for branches/3.7
- Timestamp:
- 10/29/2020 07:17:08 PM (5 years ago)
- Location:
- branches/3.7
- Files:
-
- 1 added
- 14 edited
-
. (modified) (1 prop)
-
src (modified) (1 prop)
-
src/wp-admin/admin-header.php (modified) (1 diff)
-
src/wp-admin/custom-background.php (modified) (1 diff)
-
src/wp-admin/custom-header.php (modified) (1 diff)
-
src/wp-admin/includes/media.php (modified) (1 diff)
-
src/wp-admin/includes/template.php (modified) (1 diff)
-
src/wp-admin/js/custom-background.js (modified) (2 diffs)
-
src/wp-admin/js/media-gallery.js (modified) (2 diffs)
-
src/wp-admin/media-new.php (modified) (1 diff)
-
src/wp-admin/network/site-users.php (modified) (1 diff)
-
src/wp-includes/class-wp-xmlrpc-server.php (modified) (2 diffs)
-
src/wp-includes/meta.php (modified) (1 diff)
-
tests/phpunit/tests/formatting/Utf8UriEncode.php (modified) (1 diff)
-
tests/phpunit/tests/meta/isProtectedMeta.php (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7
- Property svn:mergeinfo changed
/branches/5.5 (added) merged: 49373-49379,49381 /trunk merged: 49380,49382-49388
- Property svn:mergeinfo changed
-
branches/3.7/src
- Property svn:mergeinfo changed
/trunk/src merged: 49380,49382-49388
- Property svn:mergeinfo changed
-
branches/3.7/src/wp-admin/admin-header.php
r25616 r49409 58 58 ?> 59 59 <script type="text/javascript"> 60 addLoadEvent = function(func){if(typeof jQuery!= "undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};61 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>',62 pagenow = '<?php echo $current_screen->id; ?>',63 typenow = '<?php echo $current_screen->post_type; ?>',64 adminpage = '<?php echo $admin_body_class; ?>',65 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',66 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',60 addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(document).ready(func);else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 61 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', 62 pagenow = '<?php echo esc_js( $current_screen->id ); ?>', 63 typenow = '<?php echo esc_js( $current_screen->post_type ); ?>', 64 adminpage = '<?php echo esc_js( $admin_body_class ); ?>', 65 thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>', 66 decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>', 67 67 isRtl = <?php echo (int) is_rtl(); ?>; 68 68 </script> -
branches/3.7/src/wp-admin/custom-background.php
r25868 r49409 411 411 412 412 public function wp_set_background_image() { 413 check_ajax_referer( 'custom-background' ); 413 414 if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit; 414 415 $attachment_id = absint($_POST['attachment_id']); -
branches/3.7/src/wp-admin/custom-header.php
r25868 r49409 321 321 /* <![CDATA[ */ 322 322 (function($){ 323 var default_color = '#<?php echo get_theme_support( 'custom-header', 'default-text-color'); ?>',323 var default_color = '#<?php echo esc_js( get_theme_support( 'custom-header', 'default-text-color' ) ); ?>', 324 324 header_text_fields; 325 325 -
branches/3.7/src/wp-admin/includes/media.php
r47962 r49409 393 393 //<![CDATA[ 394 394 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 395 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',395 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 396 396 isRtl = <?php echo (int) is_rtl(); ?>; 397 397 //]]> -
branches/3.7/src/wp-admin/includes/template.php
r41456 r49409 1417 1417 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 1418 1418 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();} 1419 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>',1420 pagenow = '<?php echo $current_screen->id; ?>',1421 typenow = '<?php echo $current_screen->post_type; ?>',1422 adminpage = '<?php echo $admin_body_class; ?>',1423 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',1424 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',1419 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', 1420 pagenow = '<?php echo esc_js( $current_screen->id ); ?>', 1421 typenow = '<?php echo esc_js( $current_screen->post_type ); ?>', 1422 adminpage = '<?php echo esc_js( $admin_body_class ); ?>', 1423 thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>', 1424 decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>', 1425 1425 isRtl = <?php echo (int) is_rtl(); ?>; 1426 1426 //]]> -
branches/3.7/src/wp-admin/js/custom-background.js
r23092 r49409 56 56 // Grab the selected attachment. 57 57 var attachment = frame.state().get('selection').first(); 58 var nonceValue = $( '#_wpnonce' ).val() || ''; 58 59 59 60 // Run an AJAX request to set the background image. … … 61 62 action: 'set-background-image', 62 63 attachment_id: attachment.id, 64 _ajax_nonce: nonceValue, 63 65 size: 'full' 64 66 }).done( function() { -
branches/3.7/src/wp-admin/js/media-gallery.js
r21592 r49409 1 1 jQuery(function($){ 2 2 $( 'body' ).bind( 'click.wp-gallery', function(e){ 3 var target = $( e.target ), id, img_size ;3 var target = $( e.target ), id, img_size, nonceValue; 4 4 5 5 if ( target.hasClass( 'wp-set-header' ) ) { … … 9 9 id = target.data( 'attachment-id' ); 10 10 img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val(); 11 nonceValue = $( '#_wpnonce' ).val() && ''; 11 12 12 13 jQuery.post(ajaxurl, { 13 14 action: 'set-background-image', 14 15 attachment_id: id, 16 _ajax_nonce: nonceValue, 15 17 size: img_size 16 18 }, function(){ -
branches/3.7/src/wp-admin/media-new.php
r25616 r49409 74 74 75 75 <script type="text/javascript"> 76 var post_id = <?php echo $post_id; ?>, shortform = 3;76 var post_id = <?php echo absint( $post_id ); ?>, shortform = 3; 77 77 </script> 78 <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />78 <input type="hidden" name="post_id" id="post_id" value="<?php echo absint( $post_id ); ?>" /> 79 79 <?php wp_nonce_field('media-form'); ?> 80 80 <div id="media-items" class="hide-if-no-js"></div> -
branches/3.7/src/wp-admin/network/site-users.php
r25616 r49409 172 172 <script type='text/javascript'> 173 173 /* <![CDATA[ */ 174 var current_site_id = <?php echo $id; ?>;174 var current_site_id = <?php echo absint( $id ); ?>; 175 175 /* ]]> */ 176 176 </script> -
branches/3.7/src/wp-includes/class-wp-xmlrpc-server.php
r40703 r49409 3042 3042 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 3043 3043 3044 if ( 3045 'publish' === get_post_status( $post_id ) && 3046 ! current_user_can( 'edit_post', $post_id ) && 3047 post_password_required( $post_id ) 3048 ) { 3049 return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) ); 3050 } 3051 3052 if ( 3053 'private' === get_post_status( $post_id ) && 3054 ! current_user_can( 'read_post', $post_id ) 3055 ) { 3056 return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) ); 3057 } 3058 3059 $comment = array(); 3044 3060 $comment['comment_post_ID'] = $post_id; 3045 3061 … … 3350 3366 do_action('xmlrpc_call', 'wp.getMediaItem'); 3351 3367 3352 if ( ! $attachment = get_post($attachment_id) ) 3368 $attachment = get_post( $attachment_id ); 3369 if ( ! $attachment || 'attachment' !== $attachment->post_type ) { 3353 3370 return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); 3371 } 3354 3372 3355 3373 return $this->_prepare_media_item( $attachment ); -
branches/3.7/src/wp-includes/meta.php
r47343 r49409 892 892 * @return bool True if the key is protected, false otherwise. 893 893 */ 894 function is_protected_meta( $meta_key, $meta_type = null ) { 895 $protected = ( '_' == $meta_key[0] ); 894 function is_protected_meta( $meta_key, $meta_type = '' ) { 895 $sanitized_key = preg_replace( "/[^\x20-\x7E\p{L}]/", '', $meta_key ); 896 $protected = strlen( $sanitized_key ) > 0 && ( '_' === $sanitized_key[0] ); 896 897 897 898 return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type ); -
branches/3.7/tests/phpunit/tests/formatting/Utf8UriEncode.php
r25002 r49409 13 13 */ 14 14 function test_percent_encodes_non_reserved_characters( $utf8, $urlencoded ) { 15 $this->assertEquals( $urlencoded, utf8_uri_encode( $utf8 ) );15 $this->assertEquals( $urlencoded, utf8_uri_encode( $utf8 ) ); 16 16 } 17 17
Note: See TracChangeset
for help on using the changeset viewer.