Changeset 54545
- Timestamp:
- 10/17/2022 05:39:34 PM (22 months ago)
- Location:
- branches/5.9
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.9
- Property svn:mergeinfo changed
/trunk merged: 54397,54521-54530,54541
- Property svn:mergeinfo changed
-
branches/5.9/package.json
r53081 r54545 83 83 "@wordpress/autop": "3.2.3", 84 84 "@wordpress/blob": "3.2.2", 85 "@wordpress/block-directory": "3.0. 29",85 "@wordpress/block-directory": "3.0.", 86 86 "@wordpress/block-editor": "8.0.18", 87 "@wordpress/block-library": "6.0.2 8",87 "@wordpress/block-library": "6.0.2", 88 88 "@wordpress/block-serialization-default-parser": "4.2.3", 89 89 "@wordpress/blocks": "11.1.5", … … 91 91 "@wordpress/compose": "5.0.7", 92 92 "@wordpress/core-data": "4.0.11", 93 "@wordpress/customize-widgets": "2.0. 29",93 "@wordpress/customize-widgets": "2.0.", 94 94 "@wordpress/data": "6.1.5", 95 95 "@wordpress/data-controls": "2.2.9", … … 98 98 "@wordpress/dom": "3.2.7", 99 99 "@wordpress/dom-ready": "3.2.3", 100 "@wordpress/edit-post": "5.0. 29",101 "@wordpress/edit-site": "3.0. 29",102 "@wordpress/edit-widgets": "3.1.2 4",100 "@wordpress/edit-post": "5.0.", 101 "@wordpress/edit-site": "3.0.", 102 "@wordpress/edit-widgets": "3.1.2", 103 103 "@wordpress/editor": "12.0.22", 104 104 "@wordpress/element": "4.0.4", … … 129 129 "@wordpress/viewport": "4.0.7", 130 130 "@wordpress/warning": "2.2.2", 131 "@wordpress/widgets": "2.0.2 4",131 "@wordpress/widgets": "2.0.2", 132 132 "@wordpress/wordcount": "3.2.3", 133 133 "backbone": "1.4.0", -
branches/5.9/src/wp-admin/includes/ajax-actions.php
r53008 r54545 2985 2985 // Filter query clauses to include filenames. 2986 2986 if ( isset( $query['s'] ) ) { 2987 add_filter( ' posts_clauses', '_filter_query_attachment_filenames' );2987 add_filter( '' ); 2988 2988 } 2989 2989 -
branches/5.9/src/wp-admin/includes/post.php
r52332 r54545 1303 1303 // Filter query clauses to include filenames. 1304 1304 if ( isset( $q['s'] ) ) { 1305 add_filter( ' posts_clauses', '_filter_query_attachment_filenames' );1305 add_filter( '' ); 1306 1306 } 1307 1307 -
branches/5.9/src/wp-includes/class-wp-date-query.php
r52332 r54545 150 150 } 151 151 152 if ( isset( $date_query['relation'] ) && 'OR' === strtoupper( $date_query['relation'] )) {153 $this->relation = 'OR';152 if ( isset( $date_query['relation'] ) ) { 153 $this->relation = ; 154 154 } else { 155 155 $this->relation = 'AND'; … … 219 219 $this->validate_date_values( $queries ); 220 220 } 221 222 223 221 224 222 225 foreach ( $queries as $key => $q ) { … … 1041 1044 return $wpdb->prepare( "DATE_FORMAT( $column, %s ) $compare %f", $format, $time ); 1042 1045 } 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1043 1062 } -
branches/5.9/src/wp-includes/class-wp-query.php
r52332 r54545 445 445 public $thumbnails_cached = false; 446 446 447 448 449 450 451 452 453 447 454 /** 448 455 * Cached list of search stopwords. … … 1415 1422 1416 1423 $like = $n . $wpdb->esc_like( $term ) . $n; 1417 $search .= $wpdb->prepare( "{$searchand}(({$wpdb->posts}.post_title $like_op %s) $andor_op ({$wpdb->posts}.post_excerpt $like_op %s) $andor_op ({$wpdb->posts}.post_content $like_op %s))", $like, $like, $like ); 1424 1425 if ( ! empty( $this->allow_query_attachment_by_filename ) ) { 1426 $search .= $wpdb->prepare( "{$searchand}(({$wpdb->posts}.post_title $like_op %s) $andor_op ({$wpdb->posts}.post_excerpt $like_op %s) $andor_op ({$wpdb->posts}.post_content $like_op %s) $andor_op (sq1.meta_value $like_op %s))", $like, $like, $like, $like ); 1427 } else { 1428 $search .= $wpdb->prepare( "{$searchand}(({$wpdb->posts}.post_title $like_op %s) $andor_op ({$wpdb->posts}.post_excerpt $like_op %s) $andor_op ({$wpdb->posts}.post_content $like_op %s))", $like, $like, $like ); 1429 } 1418 1430 $searchand = ' AND '; 1419 1431 } … … 1810 1822 $q = $this->fill_query_vars( $q ); 1811 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1812 1834 // Parse meta query. 1813 1835 $this->meta_query = new WP_Meta_Query(); … … 2241 2263 } 2242 2264 2243 if ( ! empty( $this->tax_query->queries ) || ! empty( $this->meta_query->queries ) ) {2265 if ( ! empty( $this->tax_query->queries ) || ! empty( $this->meta_query->queries ) ) { 2244 2266 $groupby = "{$wpdb->posts}.ID"; 2245 2267 } … … 2317 2339 } 2318 2340 $where .= $search . $whichauthor . $whichmimetype; 2341 2342 2343 2344 2319 2345 2320 2346 if ( ! empty( $this->meta_query->queries ) ) { -
branches/5.9/src/wp-includes/comment.php
r52332 r54545 2487 2487 } 2488 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2489 2498 // Escape data pulled from DB. 2490 2499 $comment = wp_slash( $comment ); … … 2496 2505 2497 2506 $commentarr = wp_filter_comment( $commentarr ); 2507 2508 2509 2510 2498 2511 2499 2512 // Now extract the merged array. -
branches/5.9/src/wp-includes/customize/class-wp-customize-header-image-control.php
r48834 r54545 131 131 132 132 <button type="button" class="choice thumbnail" 133 data-customize-image-value="{{ {data.header.url}}}"133 data-customize-image-value="{{}}" 134 134 data-customize-header-image-data="{{JSON.stringify(data.header)}}"> 135 135 <span class="screen-reader-text"><?php _e( 'Set image' ); ?></span> 136 <img src="{{ {data.header.thumbnail_url}}}" alt="{{{data.header.alt_text || data.header.description}}}" />136 <img src="{{}}" /> 137 137 </button> 138 138 … … 159 159 <# } else { #> 160 160 161 <img src="{{ {data.header.thumbnail_url}}}" alt="{{{data.header.alt_text || data.header.description}}}" />161 <img src="{{}}" /> 162 162 163 163 <# } #> -
branches/5.9/src/wp-includes/customize/class-wp-customize-site-icon-control.php
r50556 r54545 69 69 <img src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>" /> 70 70 </div> 71 <span class="browser-title" aria-hidden="true"><# print( '<?php bloginfo( 'name'); ?>' ) #></span>71 <span class="browser-title" aria-hidden="true"><# print( '<?php ); ?>' ) #></span> 72 72 </div> 73 73 <img class="app-icon-preview" src="{{ data.attachment.sizes.full ? data.attachment.sizes.full.url : data.attachment.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>" /> -
branches/5.9/src/wp-includes/deprecated.php
r52759 r54545 4226 4226 return wp_get_duotone_filter_property( $preset ); 4227 4227 } 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 -
branches/5.9/src/wp-includes/functions.php
r53021 r54545 3529 3529 $html = __( 'The link you followed has expired.' ); 3530 3530 if ( wp_get_referer() ) { 3531 3532 3531 3533 $html .= '</p><p>'; 3532 3534 $html .= sprintf( 3533 3535 '<a href="%s">%s</a>', 3534 esc_url( remove_query_arg( 'updated', wp_get_referer() )),3536 esc_url( ), 3535 3537 __( 'Please try again.' ) 3536 3538 ); -
branches/5.9/src/wp-includes/media-template.php
r52196 r54545 1494 1494 <img id="preview-favicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>" /> 1495 1495 </div> 1496 <span class="browser-title" aria-hidden="true"><# print( '<?php bloginfo( 'name'); ?>' ) #></span>1496 <span class="browser-title" aria-hidden="true"><# print( '<?php ); ?>' ) #></span> 1497 1497 </div> 1498 1498 -
branches/5.9/src/wp-includes/pluggable.php
r52422 r54545 92 92 * @since 2.8.0 93 93 * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter. 94 * @since 5.8.0 Returns the global `$current_user` if it's the user being fetched.95 94 * 96 95 * @global WP_User $current_user The current user object which holds the user data. … … 101 100 */ 102 101 function get_user_by( $field, $value ) { 103 global $current_user;104 105 102 $userdata = WP_User::get_data_by( $field, $value ); 106 103 107 104 if ( ! $userdata ) { 108 105 return false; 109 }110 111 if ( $current_user instanceof WP_User && $current_user->ID === (int) $userdata->ID ) {112 return $current_user;113 106 } 114 107 … … 362 355 $phpmailer->clearCustomHeaders(); 363 356 $phpmailer->clearReplyTos(); 357 358 364 359 365 360 // Set "From" name and email. -
branches/5.9/src/wp-includes/post.php
r52756 r54545 7928 7928 7929 7929 /** 7930 * Filters the SQL clauses of an attachment query to include filenames.7931 *7932 * @since 4.7.07933 * @access private7934 *7935 * @global wpdb $wpdb WordPress database abstraction object.7936 *7937 * @param string[] $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,7938 * DISTINCT, fields (SELECT), and LIMITS clauses.7939 * @return string[] The modified array of clauses.7940 */7941 function _filter_query_attachment_filenames( $clauses ) {7942 global $wpdb;7943 remove_filter( 'posts_clauses', __FUNCTION__ );7944 7945 // Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.7946 $clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";7947 7948 $clauses['groupby'] = "{$wpdb->posts}.ID";7949 7950 $clauses['where'] = preg_replace(7951 "/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",7952 '$0 OR ( sq1.meta_value $1 $2 )',7953 $clauses['where']7954 );7955 7956 return $clauses;7957 }7958 7959 /**7960 7930 * Sets the last changed time for the 'posts' cache group. 7961 7931 * -
branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r52068 r54545 98 98 // Filter query clauses to include filenames. 99 99 if ( isset( $query_args['s'] ) ) { 100 add_filter( ' posts_clauses', '_filter_query_attachment_filenames' );100 add_filter( '' ); 101 101 } 102 102 -
branches/5.9/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r52068 r54545 146 146 147 147 /** 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 148 177 * Checks if a request has access to read terms in the specified taxonomy. 149 178 * … … 166 195 array( 'status' => rest_authorization_required_code() ) 167 196 ); 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 168 221 } 169 222 -
branches/5.9/src/wp-includes/user.php
r52398 r54545 1711 1711 * @since 3.0.0 1712 1712 * @since 4.4.0 'clean_user_cache' action was added. 1713 * @since 5.8.0 Refreshes the global user instance if cleaning the user cache for the current user.1714 *1715 * @global WP_User $current_user The current user object which holds the user data.1716 1713 * 1717 1714 * @param WP_User|int $user User object or ID to be cleaned from the cache 1718 1715 */ 1719 1716 function clean_user_cache( $user ) { 1720 global $current_user;1721 1722 1717 if ( is_numeric( $user ) ) { 1723 1718 $user = new WP_User( $user ); … … 1742 1737 */ 1743 1738 do_action( 'clean_user_cache', $user->ID, $user ); 1744 1745 // Refresh the global user instance if the cleaning current user.1746 if ( get_current_user_id() === (int) $user->ID ) {1747 $user_id = (int) $user->ID;1748 $current_user = null;1749 wp_set_current_user( $user_id, '' );1750 }1751 1739 } 1752 1740 -
branches/5.9/src/wp-includes/widgets.php
r52362 r54545 1579 1579 if ( is_wp_error( $rss ) ) { 1580 1580 if ( is_admin() || current_user_can( 'manage_options' ) ) { 1581 echo '<p><strong>' . __( 'RSS Error:' ) . '</strong> ' . $rss->get_error_message() . '</p>';1581 echo '<p><strong>' . __( 'RSS Error:' ) . '</strong> ' . ) . '</p>'; 1582 1582 } 1583 1583 return; … … 1702 1702 1703 1703 if ( ! empty( $args['error'] ) ) { 1704 echo '<p class="widget-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . $args['error']. '</p>';1704 echo '<p class="widget-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . . '</p>'; 1705 1705 } 1706 1706 -
branches/5.9/src/wp-mail.php
r51850 r54545 65 65 wp_die( __( 'There doesn’t seem to be any new mail.' ) ); 66 66 } 67 68 69 67 70 68 71 for ( $i = 1; $i <= $count; $i++ ) { … … 135 138 $author = sanitize_email( $author ); 136 139 if ( is_email( $author ) ) { 137 /* translators: %s: Post author email address. */138 echo '<p>' . sprintf( __( 'Author is %s' ), $author ) . '</p>';139 140 $userdata = get_user_by( 'email', $author ); 140 141 if ( ! empty( $userdata ) ) { -
branches/5.9/src/wp-trackback.php
r49108 r54545 13 13 wp( array( 'tb' => '1' ) ); 14 14 } 15 16 17 15 18 16 19 /** -
branches/5.9/tests/phpunit/tests/pluggable.php
r51404 r54545 324 324 return $signatures; 325 325 } 326 327 /**328 * @ticket 28020329 */330 public function test_get_user_by_should_return_same_instance_as_wp_get_current_user() {331 // Create a test user.332 $new_user = self::factory()->user->create( array( 'role' => 'subscriber' ) );333 334 // Set the test user as the current user.335 $current_user = wp_set_current_user( $new_user );336 337 // Get the test user using get_user_by().338 $from_get_user_by = get_user_by( 'id', $new_user );339 340 $this->assertSame( $current_user, $from_get_user_by );341 }342 326 } -
branches/5.9/tests/phpunit/tests/query/search.php
r52389 r54545 455 455 456 456 add_post_meta( $attachment, '_wp_attached_file', 'some-image1.png', true ); 457 add_filter( ' posts_clauses', '_filter_query_attachment_filenames' );457 add_filter( '' ); 458 458 459 459 // Pass post_type a string value. … … 485 485 486 486 add_post_meta( $attachment, '_wp_attached_file', 'some-image2.png', true ); 487 add_filter( ' posts_clauses', '_filter_query_attachment_filenames' );487 add_filter( '' ); 488 488 489 489 // Pass post_type an array value. … … 544 544 add_post_meta( $attachment, '_wp_attached_file', 'some-image4.png', true ); 545 545 add_post_meta( $attachment, '_test_meta_key', 'value', true ); 546 add_filter( ' posts_clauses', '_filter_query_attachment_filenames' );546 add_filter( '' ); 547 547 548 548 // Pass post_type a string value. … … 584 584 585 585 add_post_meta( $attachment, '_wp_attached_file', 'some-image5.png', true ); 586 add_filter( ' posts_clauses', '_filter_query_attachment_filenames' );586 add_filter( '' ); 587 587 588 588 // Pass post_type a string value. … … 609 609 * @ticket 22744 610 610 */ 611 public function test_filter_query_attachment_filenames_unhooks_itself() { 612 add_filter( 'posts_clauses', '_filter_query_attachment_filenames' ); 613 614 apply_filters( 615 'posts_clauses', 616 array( 617 'where' => '', 618 'groupby' => '', 619 'join' => '', 620 'orderby' => '', 621 'distinct' => '', 622 'fields' => '', 623 'limit' => '', 624 ) 625 ); 626 627 $result = has_filter( 'posts_clauses', '_filter_query_attachment_filenames' ); 628 629 $this->assertFalse( $result ); 611 public function test_wp_query_removes_filter_wp_allow_query_attachment_by_filename() { 612 $attachment = self::factory()->post->create( 613 array( 614 'post_type' => 'attachment', 615 'post_status' => 'publish', 616 'post_title' => 'bar foo', 617 'post_content' => 'foo bar', 618 'post_excerpt' => 'This post has foo', 619 ) 620 ); 621 622 add_post_meta( $attachment, '_wp_attached_file', 'some-image1.png', true ); 623 add_filter( 'wp_allow_query_attachment_by_filename', '__return_true' ); 624 625 $q = new WP_Query( 626 array( 627 's' => 'image1', 628 'fields' => 'ids', 629 'post_type' => 'attachment', 630 'post_status' => 'inherit', 631 ) 632 ); 633 634 $this->assertSame( array( $attachment ), $q->posts ); 635 636 /* 637 * WP_Query should have removed the wp_allow_query_attachment_by_filename filter 638 * and thus not match the attachment created above 639 */ 640 $q->get_posts(); 641 $this->assertEmpty( $q->posts ); 630 642 } 631 643 -
branches/5.9/tests/phpunit/tests/rest-api/rest-comments-controller.php
r52389 r54545 2973 2973 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2974 2974 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2975 2975 2976 ), 2976 2977 array( … … 2981 2982 'author_name' => 'div strong', 2982 2983 'author_user_agent' => 'div strong', 2984 2983 2985 ) 2984 2986 ); … … 2990 2992 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2991 2993 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 2994 2992 2995 ), 2993 2996 array( … … 2998 3001 'author_name' => 'div strong', 2999 3002 'author_user_agent' => 'div strong', 3003 3000 3004 ) 3001 3005 ); … … 3012 3016 'author_name' => '\\\&\\\ & &invalid; < < &lt;', 3013 3017 'author_user_agent' => '\\\&\\\ & &invalid; < < &lt;', 3018 3014 3019 ), 3015 3020 array( … … 3020 3025 'author_name' => '\\\&\\\ & &invalid; < < &lt;', 3021 3026 'author_user_agent' => '\\\&\\\ & &invalid; < < &lt;', 3027 3022 3028 ) 3023 3029 ); … … 3033 3039 'author_name' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 3034 3040 'author_user_agent' => '<div>div</div> <strong>strong</strong> <script>oh noes</script>', 3041 3035 3042 ), 3036 3043 array( … … 3041 3048 'author_name' => 'div strong', 3042 3049 'author_user_agent' => 'div strong', 3050 3043 3051 ) 3044 3052 );
Note: See TracChangeset
for help on using the changeset viewer.