Skip to content

Commit ab76874

Browse files
authored
Fix deprecated notices in PHP 8 (#1544)
* Fix deprecated notices in PHP 8 * Fix another one
1 parent baa0ced commit ab76874

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

includes/class-sanitize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public static function url_list( $value ) {
2424
$value = \explode( PHP_EOL, $value );
2525
}
2626

27-
$value = \array_map( 'trim', $value );
2827
$value = \array_filter( $value );
28+
$value = \array_map( 'trim', $value );
2929
$value = \array_map( 'sanitize_url', $value );
3030
$value = \array_unique( $value );
3131

tests/includes/class-test-migration.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,10 @@ public function test_update_actor_json_slashing() {
610610
$follower = new Follower();
611611
$follower->from_array(
612612
array(
613-
'type' => 'Person',
614-
'summary' => '<p>unescaped backslash 04\2024</p>',
613+
'type' => 'Person',
614+
'name' => 'Test Follower',
615+
'preferred_username' => 'Follower',
616+
'summary' => '<p>unescaped backslash 04\2024</p>',
615617
)
616618
);
617619
$unslashed_json = $follower->to_json();

tests/includes/class-test-scheduler.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@ public static function wpTearDownAfterClass() {
5656
public function test_reprocess_outbox() {
5757
// Create test activity objects.
5858
$activity = new Activity();
59-
$activity->set_object( array( 'content' => 'Test Content' ) );
6059
$activity->set_type( 'Create' );
6160
$activity->set_id( 'https://example.com/test-id' );
61+
$activity->set_object(
62+
array(
63+
'id' => 'https://example.com/test-id',
64+
'type' => 'Note',
65+
'content' => 'Test Content',
66+
)
67+
);
6268

6369
// Add multiple pending activities.
6470
$pending_ids = array();
@@ -149,9 +155,15 @@ function ( $event ) use ( &$scheduled_events ) {
149155
public function test_reprocess_outbox_scheduling() {
150156
// Create a test activity.
151157
$activity = new Activity();
152-
$activity->set_object( array( 'content' => 'Test Content' ) );
153158
$activity->set_type( 'Create' );
154159
$activity->set_id( 'https://example.com/test-id' );
160+
$activity->set_object(
161+
array(
162+
'id' => 'https://example.com/test-id',
163+
'type' => 'Note',
164+
'content' => 'Test Content',
165+
)
166+
);
155167

156168
$pending_id = Outbox::add( $activity, self::$user_id );
157169

0 commit comments

Comments
 (0)