Changeset 56877
- Timestamp:
- 10/12/2023 03:05:46 PM (9 months ago)
- Location:
- branches/5.3
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.3
- Property svn:mergeinfo changed
/trunk merged: 56833-56836,56838
- Property svn:mergeinfo changed
-
branches/5.3/src/wp-admin/includes/ajax-actions.php
r55788 r56877 3736 3736 $shortcode = wp_unslash( $_POST['shortcode'] ); 3737 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3738 3754 if ( ! empty( $_POST['post_ID'] ) ) { 3739 3755 $post = get_post( (int) $_POST['post_ID'] ); … … 3742 3758 // the embed shortcode requires a post 3743 3759 if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { 3744 if ( 'embed' === $shortcode) {3760 if ( ) { 3745 3761 wp_send_json_error(); 3746 3762 } -
branches/5.3/src/wp-admin/includes/class-wp-comments-list-table.php
r46391 r56877 560 560 $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID ); 561 561 562 563 564 565 566 567 568 569 570 571 572 573 574 562 575 echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>"; 563 576 $this->single_row_columns( $comment ); -
branches/5.3/src/wp-admin/includes/class-wp-list-table.php
r46777 r56877 683 683 ); 684 684 685 // No comments at all. 685 $post_object = get_post( $post_id ); 686 $edit_post_cap = $post_object ? 'edit_post' : 'edit_posts'; 687 if ( 688 current_user_can( $edit_post_cap, $post_id ) || 689 ( 690 empty( $post_object->post_password ) && 691 current_user_can( 'read_post', $post_id ) 692 ) 693 ) { 694 // The user has access to the post and thus can see comments 695 } else { 696 return false; 697 } 698 686 699 if ( ! $approved_comments && ! $pending_comments ) { 687 700 printf( -
branches/5.3/src/wp-admin/includes/dashboard.php
r46771 r56877 1014 1014 echo '<ul id="the-comment-list" data-wp-lists="list:comment">'; 1015 1015 foreach ( $comments as $comment ) { 1016 _wp_dashboard_recent_comments_row( $comment ); 1016 $comment_post = get_post( $comment->comment_post_ID ); 1017 if ( 1018 current_user_can( 'edit_post', $comment->comment_post_ID ) || 1019 ( 1020 empty( $comment_post->post_password ) && 1021 current_user_can( 'read_post', $comment->comment_post_ID ) 1022 ) 1023 ) { 1024 _wp_dashboard_recent_comments_row( $comment ); 1025 } 1017 1026 } 1018 1027 echo '</ul>'; -
branches/5.3/src/wp-includes/Requests/Hooks.php
r38049 r56877 66 66 return true; 67 67 } 68 69 70 71 68 72 } -
branches/5.3/src/wp-includes/Requests/IRI.php
r38727 r56877 704 704 } 705 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 706 720 /** 707 721 * Set the entire IRI. Returns true on success, false on failure (if there -
branches/5.3/src/wp-includes/Requests/Session.php
r38049 r56877 228 228 } 229 229 230 231 232 233 230 234 /** 231 235 * Merge a request's data with the default data -
branches/5.3/src/wp-includes/class-wp-block-type-registry.php
r45932 r56877 155 155 } 156 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 157 171 /** 158 172 * Utility method to retrieve the main instance of the class. -
branches/5.3/src/wp-includes/class-wp-theme.php
r46278 r56877 673 673 674 674 /** 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 675 697 * Adds theme data to cache. 676 698 * … … 1657 1679 return strnatcasecmp( $a->name_translated, $b->name_translated ); 1658 1680 } 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1659 1693 } -
branches/5.3/src/wp-includes/media.php
r55788 r56877 1873 1873 } 1874 1874 } elseif ( ! empty( $atts['exclude'] ) ) { 1875 $attachments = get_children( 1875 $post_parent_id = $id; 1876 $attachments = get_children( 1876 1877 array( 1877 1878 'post_parent' => $id, … … 1885 1886 ); 1886 1887 } else { 1887 $attachments = get_children( 1888 $post_parent_id = $id; 1889 $attachments = get_children( 1888 1890 array( 1889 1891 'post_parent' => $id, … … 1895 1897 ) 1896 1898 ); 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1897 1910 } 1898 1911 … … 2215 2228 } 2216 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2217 2239 if ( empty( $attachments ) ) { 2218 2240 return ''; -
branches/5.3/src/wp-includes/rest-api.php
r46544 r56877 912 912 913 913 if ( ! $result ) { 914 914 915 return new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie nonce is invalid' ), array( 'status' => 403 ) ); 915 916 } -
branches/5.3/src/wp-includes/rest-api/class-wp-rest-server.php
r46434 r56877 240 240 241 241 /** 242 * Send nocache headers on authenticated requests.243 *244 * @since 4.4.0245 *246 * @param bool $rest_send_nocache_headers Whether to send no-cache headers.247 */248 $send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() );249 if ( $send_no_cache_headers ) {250 foreach ( wp_get_nocache_headers() as $header => $header_value ) {251 if ( empty( $header_value ) ) {252 $this->remove_header( $header );253 } else {254 $this->send_header( $header, $header_value );255 }256 }257 }258 259 /**260 242 * Filters whether the REST API is enabled. 261 243 * … … 318 300 * header. 319 301 */ 302 320 303 if ( isset( $_GET['_method'] ) ) { 321 304 $request->set_method( $_GET['_method'] ); 322 305 } elseif ( isset( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ) { 323 306 $request->set_method( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ); 307 324 308 } 325 309 … … 379 363 */ 380 364 $served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this ); 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 381 387 382 388 if ( ! $served ) { -
branches/5.3/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r46070 r56877 284 284 285 285 if ( ! empty( $prepared_args['search'] ) ) { 286 287 288 286 289 $prepared_args['search'] = '*' . $prepared_args['search'] . '*'; 287 290 } -
branches/5.3/src/wp-includes/shortcodes.php
r46554 r56877 161 161 162 162 /** 163 * Search content for shortcodes and filter shortcodes through their hooks. 163 * Returns a list of registered shortcode names found in the given content. 164 * 165 * Example usage: 166 * 167 * get_shortcode_tags_in_content( '[audio src="file.mp3"][/audio] [foo] [gallery ids="1,2,3"]' ); 168 * // array( 'audio', 'gallery' ) 169 * 170 * @since 6.3.2 171 * 172 * @param string $content The content to check. 173 * @return string[] An array of registered shortcode names found in the content. 174 */ 175 function get_shortcode_tags_in_content( $content ) { 176 if ( false === strpos( $content, '[' ) ) { 177 return array(); 178 } 179 180 preg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER ); 181 if ( empty( $matches ) ) { 182 return array(); 183 } 184 185 $tags = array(); 186 foreach ( $matches as $shortcode ) { 187 $tags[] = $shortcode[2]; 188 189 if ( ! empty( $shortcode[5] ) ) { 190 $deep_tags = get_shortcode_tags_in_content( $shortcode[5] ); 191 if ( ! empty( $deep_tags ) ) { 192 $tags = array_merge( $tags, $deep_tags ); 193 } 194 } 195 } 196 197 return $tags; 198 } 199 200 /** 201 * Searches content for shortcodes and filter shortcodes through their hooks. 164 202 * 165 203 * If there are no shortcode tags defined, then the content will be returned
Note: See TracChangeset
for help on using the changeset viewer.