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 +6 -5 8.2.19.2.1 View file →
@@ -164,15 +164,16 @@
164 164 /*
165 165 * Decode entities first so a stored pseudo-tag like
166 166 * `&lt;img&gt;` becomes a real `<img>` for the next
167 167 * step to remove, then strip any tags so the JSON
168 - * response contains only plain text. `esc_url()`
169 - * rejects `javascript:` and other unsafe schemes.
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).
170 171 */
171 172 return array(
172 173 'name' => \wp_strip_all_tags( \html_entity_decode( $comment->comment_author, ENT_QUOTES ) ),
173 - 'url' => \esc_url( $comment->comment_author_url ),
174 - 'avatar' => \esc_url( \get_avatar_url( $comment ) ),
174 + 'url' => \esc_url_raw( $comment->comment_author_url ),
175 + 'avatar' => \esc_url_raw( \get_avatar_url( $comment ) ),
175 176 );
176 177 },
177 178 $comments
178 179 ),
@@ -196,9 +197,9 @@
196 197 if ( false === $collection ) {
197 198 return new \WP_Error( 'activitypub_post_not_found', \__( 'Post not found', 'activitypub' ), array( 'status' => 404 ) );
198 199 }
199 200
200 - $response = array_merge(
201 + $response = \array_merge(
201 202 array(
202 203 '@context' => Base_Object::JSON_LD_CONTEXT,
203 204 'id' => get_rest_url_by_path( \sprintf( 'posts/%d/context', $post_id ) ),
204 205 ),