Changeset 49398 for branches/4.8
- Timestamp:
- 10/29/2020 06:54:29 PM (5 years ago)
- Location:
- branches/4.8
- Files:
-
- 1 added
- 16 edited
-
. (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/ms.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) (3 diffs)
-
src/wp-admin/media-new.php (modified) (1 diff)
-
src/wp-admin/network/site-users.php (modified) (1 diff)
-
src/wp-includes/Requests/Utility/FilteredIterator.php (modified) (1 diff)
-
src/wp-includes/class-wp-xmlrpc-server.php (modified) (2 diffs)
-
src/wp-includes/formatting.php (modified) (3 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/4.8
- Property svn:mergeinfo changed
/branches/5.5 (added) merged: 49373-49379,49381 /trunk merged: 49380,49382-49388
- Property svn:mergeinfo changed
-
branches/4.8/src/wp-admin/admin-header.php
r39326 r49398 76 76 ?> 77 77 <script type="text/javascript"> 78 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();}}};79 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>',80 pagenow = '<?php echo $current_screen->id; ?>',81 typenow = '<?php echo $current_screen->post_type; ?>',82 adminpage = '<?php echo $admin_body_class; ?>',83 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',84 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',78 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();}}}; 79 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', 80 pagenow = '<?php echo esc_js( $current_screen->id ); ?>', 81 typenow = '<?php echo esc_js( $current_screen->post_type ); ?>', 82 adminpage = '<?php echo esc_js( $admin_body_class ); ?>', 83 thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>', 84 decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>', 85 85 isRtl = <?php echo (int) is_rtl(); ?>; 86 86 </script> -
branches/4.8/src/wp-admin/custom-background.php
r38948 r49398 545 545 */ 546 546 public function wp_set_background_image() { 547 check_ajax_referer( 'custom-background' ); 547 548 if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit; 548 549 $attachment_id = absint($_POST['attachment_id']); -
branches/4.8/src/wp-admin/custom-header.php
r40788 r49398 327 327 <script type="text/javascript"> 328 328 (function($){ 329 var default_color = '<?php echo $default_color; ?>',329 var default_color = '<?php echo esc_js( $default_color ); ?>', 330 330 header_text_fields; 331 331 -
branches/4.8/src/wp-admin/includes/media.php
r47980 r49398 473 473 <script type="text/javascript"> 474 474 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();}}}; 475 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',475 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 476 476 isRtl = <?php echo (int) is_rtl(); ?>; 477 477 </script> -
branches/4.8/src/wp-admin/includes/ms.php
r40632 r49398 923 923 ?> 924 924 <script type="text/javascript"> 925 var tb_pathToImage = "<?php echo includes_url( 'js/thickbox/loadingAnimation.gif', 'relative'); ?>";925 var tb_pathToImage = "<?php echo esc_js( includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ) ); ?>"; 926 926 </script> 927 927 <?php -
branches/4.8/src/wp-admin/includes/template.php
r41412 r49398 1618 1618 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();}}}; 1619 1619 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();} 1620 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>',1621 pagenow = '<?php echo $current_screen->id; ?>',1622 typenow = '<?php echo $current_screen->post_type; ?>',1623 adminpage = '<?php echo $admin_body_class; ?>',1624 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',1625 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',1620 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', 1621 pagenow = '<?php echo esc_js( $current_screen->id ); ?>', 1622 typenow = '<?php echo esc_js( $current_screen->post_type ); ?>', 1623 adminpage = '<?php echo esc_js( $admin_body_class ); ?>', 1624 thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>', 1625 decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>', 1626 1626 isRtl = <?php echo (int) is_rtl(); ?>; 1627 1627 </script> -
branches/4.8/src/wp-admin/js/custom-background.js
r38948 r49398 65 65 // Grab the selected attachment. 66 66 var attachment = frame.state().get('selection').first(); 67 var nonceValue = $( '#_wpnonce' ).val() || ''; 67 68 68 69 // Run an AJAX request to set the background image. … … 70 71 action: 'set-background-image', 71 72 attachment_id: attachment.id, 73 _ajax_nonce: nonceValue, 72 74 size: 'full' 73 75 }).done( function() { -
branches/4.8/src/wp-admin/js/media-gallery.js
r38293 r49398 10 10 */ 11 11 $( 'body' ).bind( 'click.wp-gallery', function(e) { 12 var target = $( e.target ), id, img_size ;12 var target = $( e.target ), id, img_size, nonceValue; 13 13 14 14 if ( target.hasClass( 'wp-set-header' ) ) { … … 20 20 id = target.data( 'attachment-id' ); 21 21 img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val(); 22 nonceValue = $( '#_wpnonce' ).val() && ''; 22 23 23 24 /** … … 27 28 action: 'set-background-image', 28 29 attachment_id: id, 30 _ajax_nonce: nonceValue, 29 31 size: img_size 30 32 }, function() { -
branches/4.8/src/wp-admin/media-new.php
r38725 r49398 73 73 74 74 <script type="text/javascript"> 75 var post_id = <?php echo $post_id; ?>, shortform = 3;75 var post_id = <?php echo absint( $post_id ); ?>, shortform = 3; 76 76 </script> 77 <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />77 <input type="hidden" name="post_id" id="post_id" value="<?php echo absint( $post_id ); ?>" /> 78 78 <?php wp_nonce_field('media-form'); ?> 79 79 <div id="media-items" class="hide-if-no-js"></div> -
branches/4.8/src/wp-admin/network/site-users.php
r40780 r49398 216 216 217 217 <script type="text/javascript"> 218 var current_site_id = <?php echo $id; ?>;218 var current_site_id = <?php echo absint( $id ); ?>; 219 219 </script> 220 220 -
branches/4.8/src/wp-includes/Requests/Utility/FilteredIterator.php
r37428 r49398 43 43 return $value; 44 44 } 45 45 46 } -
branches/4.8/src/wp-includes/class-wp-xmlrpc-server.php
r40692 r49398 3581 3581 } 3582 3582 3583 if ( 3584 'publish' === get_post_status( $post_id ) && 3585 ! current_user_can( 'edit_post', $post_id ) && 3586 post_password_required( $post_id ) 3587 ) { 3588 return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) ); 3589 } 3590 3591 if ( 3592 'private' === get_post_status( $post_id ) && 3593 ! current_user_can( 'read_post', $post_id ) 3594 ) { 3595 return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) ); 3596 } 3597 3583 3598 $comment = array( 3584 3599 'comment_post_ID' => $post_id, … … 3966 3981 do_action( 'xmlrpc_call', 'wp.getMediaItem' ); 3967 3982 3968 if ( ! $attachment = get_post($attachment_id) ) 3983 $attachment = get_post( $attachment_id ); 3984 if ( ! $attachment || 'attachment' !== $attachment->post_type ) { 3969 3985 return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); 3986 } 3970 3987 3971 3988 return $this->_prepare_media_item( $attachment ); -
branches/4.8/src/wp-includes/formatting.php
r47649 r49398 1077 1077 */ 1078 1078 function utf8_uri_encode( $utf8_string, $length = 0 ) { 1079 $unicode = '';1080 $values = array();1081 $num_octets = 1;1079 $unicode = ''; 1080 $values = array(); 1081 $num_octets = 1; 1082 1082 $unicode_length = 0; 1083 1083 … … 1091 1091 1092 1092 if ( $value < 128 ) { 1093 if ( $length && ( $unicode_length >= $length ) ) 1093 if ( $length && ( $unicode_length >= $length ) ) { 1094 1094 break; 1095 $unicode .= chr($value); 1095 } 1096 $unicode .= chr( $value ); 1096 1097 $unicode_length++; 1097 1098 } else { … … 1994 1995 $title = mb_strtolower($title, 'UTF-8'); 1995 1996 } 1996 $title = utf8_uri_encode( $title, 200);1997 $title = utf8_uri_encode( $title, 200 ); 1997 1998 } 1998 1999 -
branches/4.8/src/wp-includes/meta.php
r42913 r49398 917 917 * @return bool True if the key is protected, false otherwise. 918 918 */ 919 function is_protected_meta( $meta_key, $meta_type = null ) { 920 $protected = ( '_' == $meta_key[0] ); 919 function is_protected_meta( $meta_key, $meta_type = '' ) { 920 $sanitized_key = preg_replace( "/[^\x20-\x7E\p{L}]/", '', $meta_key ); 921 $protected = strlen( $sanitized_key ) > 0 && ( '_' == $sanitized_key[0] ); 921 922 922 923 /** -
branches/4.8/tests/phpunit/tests/formatting/Utf8UriEncode.php
r25002 r49398 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.