Skip to content

Commit

Permalink
Followers: Fix backslash breaking actor json (#1373)
Browse files Browse the repository at this point in the history
* Create failing tests

* Slash actor json

* Changelog

* Document ticket for future reference
  • Loading branch information
obenland committed Feb 26, 2025
1 parent d30c60d commit 2da88f7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

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

## [5.3.0] - 2025-02-25

Expand Down
2 changes: 1 addition & 1 deletion includes/model/class-follower.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function delete() {
protected function get_post_meta_input() {
$meta_input = array();
$meta_input['_activitypub_inbox'] = $this->get_shared_inbox();
$meta_input['_activitypub_actor_json'] = $this->to_json();
$meta_input['_activitypub_actor_json'] = wp_slash( $this->to_json() );

return $meta_input;
}
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ For reasons of data protection, it is not possible to see the followers of other
= 5.3.1 =

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

= 5.3.0 =

Expand Down
2 changes: 2 additions & 0 deletions tests/includes/collection/class-test-followers.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ class Test_Followers extends \WP_UnitTestCase {
),
'[email protected]' => array(
'id' => 'https://user2.example.com',
'type' => 'Person',
'url' => 'https://user2.example.com',
'inbox' => 'https://user2.example.com/inbox',
'name' => 'úser2',
'preferredUsername' => 'user2',
'summary' => 'father since 04\24', // @ticket https://github.com/Automattic/wordpress-activitypub/pull/1373
),
'[email protected]' => array(
'url' => 'https://error.example.com',
Expand Down

0 comments on commit 2da88f7

Please sign in to comment.