Skip to content

Commit 2da88f7

Browse files
committed
Followers: Fix backslash breaking actor json (#1373)
* Create failing tests * Slash actor json * Changelog * Document ticket for future reference
1 parent d30c60d commit 2da88f7

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
* Blog profile settings can be saved again without errors.
13+
* Followers with backslashes in their descriptions no longer break their actor representation.
1314

1415
## [5.3.0] - 2025-02-25
1516

includes/model/class-follower.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function delete() {
230230
protected function get_post_meta_input() {
231231
$meta_input = array();
232232
$meta_input['_activitypub_inbox'] = $this->get_shared_inbox();
233-
$meta_input['_activitypub_actor_json'] = $this->to_json();
233+
$meta_input['_activitypub_actor_json'] = wp_slash( $this->to_json() );
234234

235235
return $meta_input;
236236
}

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ For reasons of data protection, it is not possible to see the followers of other
132132
= 5.3.1 =
133133

134134
* Fixed: Blog profile settings can be saved again without errors.
135+
* Fixed: Followers with backslashes in their descriptions no longer break their actor representation.
135136

136137
= 5.3.0 =
137138

tests/includes/collection/class-test-followers.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ class Test_Followers extends \WP_UnitTestCase {
6262
),
6363
'[email protected]' => array(
6464
'id' => 'https://user2.example.com',
65+
'type' => 'Person',
6566
'url' => 'https://user2.example.com',
6667
'inbox' => 'https://user2.example.com/inbox',
6768
'name' => 'úser2',
6869
'preferredUsername' => 'user2',
70+
'summary' => 'father since 04\24', // @ticket https://github.com/Automattic/wordpress-activitypub/pull/1373
6971
),
7072
'[email protected]' => array(
7173
'url' => 'https://error.example.com',

0 commit comments

Comments
 (0)