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/transformer/class-base.php +9 -11 8.2.1 → 9.2.1 View file →
@@ -39,10 +39,8 @@
39 39
40 40 /**
41 41 * The WP_Post or WP_Comment object.
42 42 *
43 - * @deprecated version 5.0.0
44 - *
45 43 * @var \WP_Post|\WP_Comment
46 44 */
47 45 protected $wp_object;
48 46
@@ -186,9 +184,9 @@
186 184 if ( ! \is_wp_error( $actor ) ) {
187 185 $followers = $actor->get_followers();
188 186 }
189 187
190 - $mentions = array_values( $this->get_mentions() );
188 + $mentions = \array_values( $this->get_mentions() );
191 189
192 190 if ( $this->get_in_reply_to() ) {
193 191 $object = Http::get_remote_object( $this->get_in_reply_to() );
194 192 if ( $object && ! \is_wp_error( $object ) && isset( $object['attributedTo'] ) ) {
@@ -279,9 +277,9 @@
279 277 * @param mixed $item The post object.
280 278 *
281 279 * @return string The filtered locale of the post.
282 280 */
283 - return apply_filters( 'activitypub_locale', $lang, $this->item );
281 + return \apply_filters( 'activitypub_locale', $lang, $this->item );
284 282 }
285 283
286 284 /**
287 285 * Returns the default media type for an Object.
@@ -348,9 +346,9 @@
348 346
349 347 foreach ( $mentions as $mention => $url ) {
350 348 $tags[] = array(
351 349 'type' => 'Mention',
352 - 'href' => \esc_url( $url ),
350 + 'href' => \esc_url_raw( $url ),
353 351 'name' => \esc_html( $mention ),
354 352 );
355 353 }
356 354
@@ -373,13 +371,13 @@
373 371 */
374 372 protected function get_mentions() {
375 373 $content = '';
376 374
377 - if ( method_exists( $this, 'get_content' ) ) {
375 + if ( \method_exists( $this, 'get_content' ) ) {
378 376 $content = $content . ' ' . $this->get_content();
379 377 }
380 378
381 - if ( method_exists( $this, 'get_summary' ) ) {
379 + if ( \method_exists( $this, 'get_summary' ) ) {
382 380 $content = $content . ' ' . $this->get_summary();
383 381 }
384 382
385 383 /**
@@ -390,9 +388,9 @@
390 388 * @param \WP_Post $post The post object.
391 389 *
392 390 * @return array The filtered mentions.
393 391 */
394 - return apply_filters(
392 + return \apply_filters(
395 393 'activitypub_extract_mentions',
396 394 array(),
397 395 $content,
398 396 $this->item
@@ -529,9 +527,9 @@
529 527
530 528 if ( $thumbnail ) {
531 529 $image = array(
532 530 'type' => 'Image',
533 - 'url' => \esc_url( $thumbnail[0] ),
531 + 'url' => \esc_url_raw( $thumbnail[0] ),
534 532 'mediaType' => \esc_attr( $mime_type ),
535 533 );
536 534
537 535 if ( ! empty( $media['alt'] ) ) {
@@ -558,9 +556,9 @@
558 556 $meta = \wp_get_attachment_metadata( $id );
559 557 $attachment = array(
560 558 'type' => \ucfirst( $media_type ),
561 559 'mediaType' => \esc_attr( $mime_type ),
562 - 'url' => \esc_url( \wp_get_attachment_url( $id ) ),
560 + 'url' => \esc_url_raw( \wp_get_attachment_url( $id ) ),
563 561 'name' => \esc_attr( \get_the_title( $id ) ),
564 562 );
565 563
566 564 // Height and width for videos.
@@ -724,9 +722,9 @@
724 722
725 723 return \array_filter(
726 724 $attachments,
727 725 static function ( $attachment ) use ( &$seen_ids ) {
728 - if ( isset( $attachment['id'] ) && ! in_array( $attachment['id'], $seen_ids, true ) ) {
726 + if ( isset( $attachment['id'] ) && ! \in_array( $attachment['id'], $seen_ids, true ) ) {
729 727 $seen_ids[] = $attachment['id'];
730 728 return true;
731 729 }
732 730 return false;