Changeset 49403
- Timestamp:
- 10/29/2020 07:05:53 PM (5 years ago)
- Location:
- branches/4.3
- Files:
-
- 1 added
- 15 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) (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/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.3
- Property svn:mergeinfo changed
/branches/5.5 (added) merged: 49373-49379,49381 /trunk merged: 49380,49382-49388
- Property svn:mergeinfo changed
-
branches/4.3/src/wp-admin/admin-header.php
r32917 r49403 71 71 ?> 72 72 <script type="text/javascript"> 73 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();}}};74 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>',75 pagenow = '<?php echo $current_screen->id; ?>',76 typenow = '<?php echo $current_screen->post_type; ?>',77 adminpage = '<?php echo $admin_body_class; ?>',78 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',79 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',73 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();}}}; 74 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', 75 pagenow = '<?php echo esc_js( $current_screen->id ); ?>', 76 typenow = '<?php echo esc_js( $current_screen->post_type ); ?>', 77 adminpage = '<?php echo esc_js( $admin_body_class ); ?>', 78 thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>', 79 decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>', 80 80 isRtl = <?php echo (int) is_rtl(); ?>; 81 81 </script> -
branches/4.3/src/wp-admin/custom-background.php
r32974 r49403 461 461 */ 462 462 public function wp_set_background_image() { 463 check_ajax_referer( 'custom-background' ); 463 464 if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit; 464 465 $attachment_id = absint($_POST['attachment_id']); -
branches/4.3/src/wp-admin/custom-header.php
r33180 r49403 321 321 <script type="text/javascript"> 322 322 (function($){ 323 var default_color = '<?php echo $default_color; ?>',323 var default_color = '<?php echo esc_js( $default_color ); ?>', 324 324 header_text_fields; 325 325 -
branches/4.3/src/wp-admin/includes/media.php
r47982 r49403 455 455 <script type="text/javascript"> 456 456 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();}}}; 457 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',457 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 458 458 isRtl = <?php echo (int) is_rtl(); ?>; 459 459 </script> -
branches/4.3/src/wp-admin/includes/ms.php
r33569 r49403 978 978 ?> 979 979 <script type="text/javascript"> 980 var tb_pathToImage = "<?php echo includes_url( 'js/thickbox/loadingAnimation.gif', 'relative'); ?>";980 var tb_pathToImage = "<?php echo esc_js( includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ) ); ?>"; 981 981 </script> 982 982 <?php -
branches/4.3/src/wp-admin/includes/template.php
r41444 r49403 1619 1619 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();}}}; 1620 1620 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();} 1621 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative'); ?>',1622 pagenow = '<?php echo $current_screen->id; ?>',1623 typenow = '<?php echo $current_screen->post_type; ?>',1624 adminpage = '<?php echo $admin_body_class; ?>',1625 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',1626 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',1621 var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', 1622 pagenow = '<?php echo esc_js( $current_screen->id ); ?>', 1623 typenow = '<?php echo esc_js( $current_screen->post_type ); ?>', 1624 adminpage = '<?php echo esc_js( $admin_body_class ); ?>', 1625 thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>', 1626 decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>', 1627 1627 isRtl = <?php echo (int) is_rtl(); ?>; 1628 1628 </script> -
branches/4.3/src/wp-admin/js/custom-background.js
r26158 r49403 57 57 // Grab the selected attachment. 58 58 var attachment = frame.state().get('selection').first(); 59 var nonceValue = $( '#_wpnonce' ).val() || ''; 59 60 60 61 // Run an AJAX request to set the background image. … … 62 63 action: 'set-background-image', 63 64 attachment_id: attachment.id, 65 _ajax_nonce: nonceValue, 64 66 size: 'full' 65 67 }).done( function() { -
branches/4.3/src/wp-admin/js/media-gallery.js
r26232 r49403 2 2 jQuery(function($){ 3 3 $( 'body' ).bind( 'click.wp-gallery', function(e){ 4 var target = $( e.target ), id, img_size ;4 var target = $( e.target ), id, img_size, nonceValue; 5 5 6 6 if ( target.hasClass( 'wp-set-header' ) ) { … … 10 10 id = target.data( 'attachment-id' ); 11 11 img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val(); 12 nonceValue = $( '#_wpnonce' ).val() && ''; 12 13 13 14 jQuery.post(ajaxurl, { 14 15 action: 'set-background-image', 15 16 attachment_id: id, 17 _ajax_nonce: nonceValue, 16 18 size: img_size 17 19 }, function(){ -
branches/4.3/src/wp-admin/media-new.php
r32974 r49403 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.3/src/wp-admin/network/site-users.php
r34118 r49403 180 180 181 181 <script type="text/javascript"> 182 var current_site_id = <?php echo $id; ?>;182 var current_site_id = <?php echo absint( $id ); ?>; 183 183 </script> 184 184 -
branches/4.3/src/wp-includes/class-wp-xmlrpc-server.php
r40697 r49403 3484 3484 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 3485 3485 3486 if ( 3487 'publish' === get_post_status( $post_id ) && 3488 ! current_user_can( 'edit_post', $post_id ) && 3489 post_password_required( $post_id ) 3490 ) { 3491 return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) ); 3492 } 3493 3494 if ( 3495 'private' === get_post_status( $post_id ) && 3496 ! current_user_can( 'read_post', $post_id ) 3497 ) { 3498 return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) ); 3499 } 3500 3486 3501 $comment = array(); 3487 3502 $comment['comment_post_ID'] = $post_id; … … 3848 3863 do_action( 'xmlrpc_call', 'wp.getMediaItem' ); 3849 3864 3850 if ( ! $attachment = get_post($attachment_id) ) 3865 $attachment = get_post( $attachment_id ); 3866 if ( ! $attachment || 'attachment' !== $attachment->post_type ) { 3851 3867 return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); 3868 } 3852 3869 3853 3870 return $this->_prepare_media_item( $attachment ); -
branches/4.3/src/wp-includes/formatting.php
r47656 r49403 1005 1005 */ 1006 1006 function utf8_uri_encode( $utf8_string, $length = 0 ) { 1007 $unicode = '';1008 $values = array();1009 $num_octets = 1;1007 $unicode = ''; 1008 $values = array(); 1009 $num_octets = 1; 1010 1010 $unicode_length = 0; 1011 1011 … … 1019 1019 1020 1020 if ( $value < 128 ) { 1021 if ( $length && ( $unicode_length >= $length ) ) 1021 if ( $length && ( $unicode_length >= $length ) ) { 1022 1022 break; 1023 $unicode .= chr($value); 1023 } 1024 $unicode .= chr( $value ); 1024 1025 $unicode_length++; 1025 1026 } else { … … 1541 1542 $title = mb_strtolower($title, 'UTF-8'); 1542 1543 } 1543 $title = utf8_uri_encode( $title, 200);1544 $title = utf8_uri_encode( $title, 200 ); 1544 1545 } 1545 1546 -
branches/4.3/src/wp-includes/meta.php
r33231 r49403 1636 1636 * @return bool True if the key is protected, false otherwise. 1637 1637 */ 1638 function is_protected_meta( $meta_key, $meta_type = null ) { 1639 $protected = ( '_' == $meta_key[0] ); 1638 function is_protected_meta( $meta_key, $meta_type = '' ) { 1639 $sanitized_key = preg_replace( "/[^\x20-\x7E\p{L}]/", '', $meta_key ); 1640 $protected = strlen( $sanitized_key ) > 0 && ( '_' === $sanitized_key[0] ); 1640 1641 1641 1642 /** -
branches/4.3/tests/phpunit/tests/formatting/Utf8UriEncode.php
r25002 r49403 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.