Skip to content

Commit 5973182

Browse files
authored
Merge branch 'trunk' into feature/40365-rest-sites-endpoint
2 parents 6cb9041 + 2ca6eae commit 5973182

10 files changed

Lines changed: 53 additions & 20 deletions

File tree

‎src/wp-admin/includes/class-wp-site-icon.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,22 @@ class WP_Site_Icon {
4141
/*
4242
* Square, medium sized tiles for IE11+.
4343
*
44-
* @link https://msdn.microsoft.com/library/dn455106(v=vs.85).aspx
44+
* @link https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/dn455106(v=vs.85)
4545
*/
4646
270,
4747

4848
/*
4949
* App icon for Android/Chrome.
5050
*
5151
* @link https://developer.chrome.com/blog/support-for-theme-color-in-chrome-39-for-android
52+
* @link https://web.dev/articles/icons-and-browser-colors
5253
*/
5354
192,
5455

5556
/*
5657
* App icons up to iPhone 6 Plus.
5758
*
58-
* @link https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
59+
* @link https://developer.apple.com/design/human-interface-guidelines/app-icons
5960
*/
6061
180,
6162

‎src/wp-includes/deprecated.php‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,6 +3843,30 @@ function get_paged_template() {
38433843
return get_query_template( 'paged' );
38443844
}
38453845

3846+
/**
3847+
* Handles parsing errors in `wp_kses_hair()`.
3848+
*
3849+
* The general plan is to remove everything to and including some whitespace,
3850+
* but it deals with quotes and apostrophes as well.
3851+
*
3852+
* Note: This was previously used in certain cases when {@see \wp_kses_hair()}
3853+
* struggled to recognize HTML syntax. Since 7.0.0 when that function was
3854+
* rewritten to rely on the HTML API, those ambiguous situations no longer
3855+
* exist, and this function is no longer relevant.
3856+
*
3857+
* @since 1.0.0
3858+
* @deprecated 7.2.0 This was only meant to be used internally and the calling
3859+
* function has been updated and no-longer needs it.
3860+
*
3861+
* @param string $attr
3862+
* @return string
3863+
*/
3864+
function wp_kses_html_error( $attr ) {
3865+
_deprecated_function( __FUNCTION__, '7.2.0' );
3866+
3867+
return preg_replace( '/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $attr );
3868+
}
3869+
38463870
/**
38473871
* Removes the HTML JavaScript entities found in early versions of Netscape 4.
38483872
*

‎src/wp-includes/kses.php‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,21 +2068,6 @@ function wp_kses_array_lc( $inarray ) {
20682068
return $outarray;
20692069
}
20702070

2071-
/**
2072-
* Handles parsing errors in `wp_kses_hair()`.
2073-
*
2074-
* The general plan is to remove everything to and including some whitespace,
2075-
* but it deals with quotes and apostrophes as well.
2076-
*
2077-
* @since 1.0.0
2078-
*
2079-
* @param string $attr
2080-
* @return string
2081-
*/
2082-
function wp_kses_html_error( $attr ) {
2083-
return preg_replace( '/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $attr );
2084-
}
2085-
20862071
/**
20872072
* Sanitizes content from bad protocols and other characters.
20882073
*

‎tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ public function test_register_incorrect_already_registered_ability() {
515515
public function test_register_new_ability() {
516516
$result = $this->registry->register( self::$test_ability_name, self::$test_ability_args );
517517

518+
// Keep assertEquals() because the objects are intentionally compared by value.
518519
$this->assertEquals(
519520
new WP_Ability( self::$test_ability_name, self::$test_ability_args ),
520521
$result

‎tests/phpunit/tests/abilities-api/wpRegisterAbility.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ public function test_unregister_existing_ability() {
519519

520520
$result = wp_unregister_ability( self::$test_ability_name );
521521

522+
// Keep assertEquals() because the objects are intentionally compared by value.
522523
$this->assertEquals(
523524
new WP_Ability( self::$test_ability_name, self::$test_ability_args ),
524525
$result
@@ -581,6 +582,7 @@ static function ( $instance ) use ( $name, $args ) {
581582

582583
$result = wp_get_ability( $name );
583584

585+
// Keep assertEquals() because the objects are intentionally compared by value.
584586
$this->assertEquals(
585587
new WP_Ability( $name, $args ),
586588
$result,
@@ -699,6 +701,8 @@ public function test_get_all_registered_abilities() {
699701
);
700702

701703
$result = wp_get_abilities();
704+
705+
// Keep assertEquals() because the objects are intentionally compared by value.
702706
$this->assertEquals( $expected, $result );
703707
}
704708
}

‎tests/phpunit/tests/block-bindings/register.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public function test_get_all_registered() {
7979
);
8080

8181
$registered = get_all_registered_block_bindings_sources();
82+
83+
// Keep assertEquals() because the objects are intentionally compared by value.
8284
$this->assertEquals( $expected, $registered );
8385
}
8486

@@ -95,6 +97,8 @@ public function test_unregister_block_source() {
9597
register_block_bindings_source( self::$test_source_name, self::$test_source_properties );
9698

9799
$result = unregister_block_bindings_source( self::$test_source_name );
100+
101+
// Keep assertEquals() because the objects are intentionally compared by value.
98102
$this->assertEquals(
99103
new WP_Block_Bindings_Source(
100104
self::$test_source_name,

‎tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ public function test_register_invalid_string_uses_context() {
188188
*/
189189
public function test_register_block_binding_source() {
190190
$result = $this->registry->register( self::$test_source_name, self::$test_source_properties );
191+
192+
// Keep assertEquals() because the objects are intentionally compared by value.
191193
$this->assertEquals(
192194
new WP_Block_Bindings_Source(
193195
self::$test_source_name,
@@ -231,6 +233,8 @@ public function test_unregister_block_source() {
231233
$this->registry->register( self::$test_source_name, self::$test_source_properties );
232234

233235
$result = $this->registry->unregister( self::$test_source_name );
236+
237+
// Keep assertEquals() because the objects are intentionally compared by value.
234238
$this->assertEquals(
235239
new WP_Block_Bindings_Source(
236240
self::$test_source_name,
@@ -269,6 +273,8 @@ public function test_get_all_registered() {
269273
);
270274

271275
$registered = $this->registry->get_all_registered();
276+
277+
// Keep assertEquals() because the objects are intentionally compared by value.
272278
$this->assertEquals( $expected, $registered );
273279
}
274280

@@ -312,6 +318,7 @@ public function test_get_registered() {
312318
$expected = new WP_Block_Bindings_Source( $source_two_name, $source_two_properties );
313319
$result = $this->registry->get_registered( 'test/source-two' );
314320

321+
// Keep assertEquals() because the objects are intentionally compared by value.
315322
$this->assertEquals(
316323
$expected,
317324
$result

‎tests/phpunit/tests/fonts/font-library/fontLibraryHooks.php‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
*/
1111
class Tests_Fonts_FontLibraryHooks extends WP_UnitTestCase {
1212

13+
/**
14+
* Tear down the test fixture.
15+
*/
16+
public function tear_down() {
17+
// Remove all fonts uploaded during the tests.
18+
$this->remove_added_uploads();
19+
parent::tear_down();
20+
}
21+
1322
public function test_deleting_font_family_deletes_child_font_faces() {
1423
$font_family_id = self::factory()->post->create(
1524
array(

‎tests/phpunit/tests/media.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ public function data_wp_prepare_attachment_for_js_filesize(): array {
956956
* @param mixed $filesize The `filesize` value stored in the attachment metadata.
957957
*/
958958
public function test_wp_prepare_attachment_for_js_filesize_falls_back_to_the_file( $filesize ) {
959-
$id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' );
959+
$id = self::$large_id;
960960
$this->assertIsInt( $id );
961961
$post = get_post( $id );
962962
$this->assertInstanceOf( WP_Post::class, $post );

‎tests/phpunit/tests/user/getActiveBlogForUser.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public function test_get_active_blog_for_user_without_primary_site() {
6969

7070
$result = get_active_blog_for_user( self::$user_id );
7171

72-
wp_delete_site( $primary_site_id );
73-
7472
$this->assertSame( $primary_site_id, $result->id );
7573
}
7674

0 commit comments

Comments
 (0)