Changeset 56870
- Timestamp:
- 10/12/2023 02:59:09 PM (10 months ago)
- Location:
- branches/6.0
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0
- Property svn:mergeinfo changed
/trunk merged: 56833-56838
- Property svn:mergeinfo changed
-
branches/6.0/src/wp-admin/includes/ajax-actions.php
r55773 r56870 3823 3823 $shortcode = wp_unslash( $_POST['shortcode'] ); 3824 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3825 3841 if ( ! empty( $_POST['post_ID'] ) ) { 3826 3842 $post = get_post( (int) $_POST['post_ID'] ); … … 3829 3845 // The embed shortcode requires a post. 3830 3846 if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { 3831 if ( 'embed' === $shortcode) {3847 if ( ) { 3832 3848 wp_send_json_error(); 3833 3849 } -
branches/6.0/src/wp-admin/includes/class-wp-comments-list-table.php
r52957 r56870 640 640 641 641 $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID ); 642 643 644 645 646 647 648 649 650 651 652 653 654 642 655 643 656 echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>"; -
branches/6.0/src/wp-admin/includes/class-wp-list-table.php
r53040 r56870 739 739 $pending_comments_number 740 740 ); 741 742 743 744 745 746 747 748 749 750 751 752 753 754 741 755 742 756 if ( ! $approved_comments && ! $pending_comments ) { -
branches/6.0/src/wp-admin/includes/dashboard.php
r53385 r56870 1086 1086 echo '<ul id="the-comment-list" data-wp-lists="list:comment">'; 1087 1087 foreach ( $comments as $comment ) { 1088 _wp_dashboard_recent_comments_row( $comment ); 1088 1089 $comment_post = get_post( $comment->comment_post_ID ); 1090 if ( 1091 current_user_can( 'edit_post', $comment->comment_post_ID ) || 1092 ( 1093 empty( $comment_post->post_password ) && 1094 current_user_can( 'read_post', $comment->comment_post_ID ) 1095 ) 1096 ) { 1097 _wp_dashboard_recent_comments_row( $comment ); 1098 } 1089 1099 } 1090 1100 echo '</ul>'; -
branches/6.0/src/wp-admin/includes/user.php
r53063 r56870 607 607 * 608 608 * @since 5.6.0 609 610 609 611 * 610 612 * @param array $request { … … 622 624 $error = new WP_Error(); 623 625 624 if ( ! empty( $request['success_url'] ) ) { 625 $scheme = wp_parse_url( $request['success_url'], PHP_URL_SCHEME ); 626 627 if ( 'http' === $scheme ) { 626 if ( isset( $request['success_url'] ) ) { 627 $validated_success_url = wp_is_authorize_application_redirect_url_valid( $request['success_url'] ); 628 if ( is_wp_error( $validated_success_url ) ) { 628 629 $error->add( 629 'invalid_redirect_scheme',630 __( 'The success URL must be served over a secure connection.')630 , 631 ) 631 632 ); 632 633 } 633 634 } 634 635 635 if ( ! empty( $request['reject_url'] ) ) { 636 $scheme = wp_parse_url( $request['reject_url'], PHP_URL_SCHEME ); 637 638 if ( 'http' === $scheme ) { 636 if ( isset( $request['reject_url'] ) ) { 637 $validated_reject_url = wp_is_authorize_application_redirect_url_valid( $request['reject_url'] ); 638 if ( is_wp_error( $validated_reject_url ) ) { 639 639 $error->add( 640 'invalid_redirect_scheme',641 __( 'The rejection URL must be served over a secure connection.')640 , 641 ) 642 642 ); 643 643 } … … 668 668 return true; 669 669 } 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 -
branches/6.0/src/wp-includes/Requests/Hooks.php
r52328 r56870 66 66 return true; 67 67 } 68 69 70 71 68 72 } -
branches/6.0/src/wp-includes/Requests/IRI.php
r52328 r56870 706 706 } 707 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 708 722 /** 709 723 * Set the entire IRI. Returns true on success, false on failure (if there -
branches/6.0/src/wp-includes/Requests/Session.php
r52328 r56870 230 230 } 231 231 232 233 234 235 232 236 /** 233 237 * Merge a request's data with the default data -
branches/6.0/src/wp-includes/class-wp-block-patterns-registry.php
r53405 r56870 187 187 } 188 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 189 204 /** 190 205 * Utility method to retrieve the main instance of the class. -
branches/6.0/src/wp-includes/class-wp-block-type-registry.php
r51154 r56870 168 168 } 169 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 170 184 /** 171 185 * Utility method to retrieve the main instance of the class. -
branches/6.0/src/wp-includes/class-wp-theme.php
r53417 r56870 715 715 716 716 /** 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 717 739 * Adds theme data to cache. 718 740 * … … 1772 1794 return strnatcasecmp( $a->name_translated, $b->name_translated ); 1773 1795 } 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1774 1808 } -
branches/6.0/src/wp-includes/media.php
r55773 r56870 2378 2378 } 2379 2379 } elseif ( ! empty( $atts['exclude'] ) ) { 2380 2380 2381 $attachments = get_children( 2381 2382 array( … … 2390 2391 ); 2391 2392 } else { 2393 2392 2394 $attachments = get_children( 2393 2395 array( … … 2400 2402 ) 2401 2403 ); 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2402 2415 } 2403 2416 … … 2728 2741 } 2729 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2730 2752 if ( empty( $attachments ) ) { 2731 2753 return ''; -
branches/6.0/src/wp-includes/rest-api.php
r53217 r56870 1053 1053 1054 1054 if ( ! $result ) { 1055 1055 1056 return new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie check failed' ), array( 'status' => 403 ) ); 1056 1057 } -
branches/6.0/src/wp-includes/rest-api/class-wp-rest-server.php
r53110 r56870 332 332 333 333 /** 334 * Filters whether to send nocache headers on a REST API request.335 *336 * @since 4.4.0337 *338 * @param bool $rest_send_nocache_headers Whether to send no-cache headers.339 */340 $send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() );341 if ( $send_no_cache_headers ) {342 foreach ( wp_get_nocache_headers() as $header => $header_value ) {343 if ( empty( $header_value ) ) {344 $this->remove_header( $header );345 } else {346 $this->send_header( $header, $header_value );347 }348 }349 }350 351 /**352 334 * Filters whether the REST API is enabled. 353 335 * … … 403 385 * header. 404 386 */ 387 405 388 if ( isset( $_GET['_method'] ) ) { 406 389 $request->set_method( $_GET['_method'] ); 407 390 } elseif ( isset( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ) { 408 391 $request->set_method( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ); 392 409 393 } 410 394 … … 465 449 */ 466 450 $served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this ); 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 467 473 468 474 if ( ! $served ) { -
branches/6.0/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r52978 r56870 319 319 320 320 if ( ! empty( $prepared_args['search'] ) ) { 321 322 323 321 324 $prepared_args['search'] = '*' . $prepared_args['search'] . '*'; 322 325 } -
branches/6.0/src/wp-includes/shortcodes.php
r51154 r56870 171 171 172 172 /** 173 * Search content for shortcodes and filter shortcodes through their hooks. 173 * Returns a list of registered shortcode names found in the given content. 174 * 175 * Example usage: 176 * 177 * get_shortcode_tags_in_content( '[audio src="file.mp3"][/audio] [foo] [gallery ids="1,2,3"]' ); 178 * // array( 'audio', 'gallery' ) 179 * 180 * @since 6.3.2 181 * 182 * @param string $content The content to check. 183 * @return string[] An array of registered shortcode names found in the content. 184 */ 185 function get_shortcode_tags_in_content( $content ) { 186 if ( false === strpos( $content, '[' ) ) { 187 return array(); 188 } 189 190 preg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER ); 191 if ( empty( $matches ) ) { 192 return array(); 193 } 194 195 $tags = array(); 196 foreach ( $matches as $shortcode ) { 197 $tags[] = $shortcode[2]; 198 199 if ( ! empty( $shortcode[5] ) ) { 200 $deep_tags = get_shortcode_tags_in_content( $shortcode[5] ); 201 if ( ! empty( $deep_tags ) ) { 202 $tags = array_merge( $tags, $deep_tags ); 203 } 204 } 205 } 206 207 return $tags; 208 } 209 210 /** 211 * Searches content for shortcodes and filter shortcodes through their hooks. 174 212 * 175 213 * This function is an alias for do_shortcode().
Note: See TracChangeset
for help on using the changeset viewer.