PluginProbe
ActivityPub / 9.2.1
ActivityPub v9.2.1
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/rest/class-post-controller.php +7 -5 9.3.0 → 9.2.1 View file →
@@ -13,9 +13,8 @@
13 13 use Activitypub\Sanitize;
14 14 use Activitypub\Webfinger;
15 15
16 16 use function Activitypub\get_post_id;
17 -use function Activitypub\get_reaction_author_name;
18 17 use function Activitypub\get_rest_url_by_path;
19 18
20 19 /**
21 20 * Class Post_Controller
@@ -162,14 +161,17 @@
162 161 'label' => $label,
163 162 'items' => \array_map(
164 163 static function ( $comment ) {
165 164 /*
166 - * `esc_url_raw()` rejects `javascript:` and other unsafe
167 - * schemes without HTML-encoding ampersands (this is JSON,
168 - * not markup).
165 + * Decode entities first so a stored pseudo-tag like
166 + * `&lt;img&gt;` becomes a real `<img>` for the next
167 + * step to remove, then strip any tags so the JSON
168 + * response contains only plain text. `esc_url_raw()`
169 + * rejects `javascript:` and other unsafe schemes without
170 + * HTML-encoding ampersands (this is JSON, not markup).
169 171 */
170 172 return array(
171 - 'name' => get_reaction_author_name( $comment ),
173 + 'name' => \wp_strip_all_tags( \html_entity_decode( $comment->comment_author, ENT_QUOTES ) ),
172 174 'url' => \esc_url_raw( $comment->comment_author_url ),
173 175 'avatar' => \esc_url_raw( \get_avatar_url( $comment ) ),
174 176 );
175 177 },