Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/03/2019 05:27:08 PM (6 years ago)
Author:
imath
Message:

More constistent escaping in Activity action strings

This commit is also fixing a regression introduced in version 4.3.0 about activity streams secondary avatars.

Fixes #8090 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-activity.php

    r12281 r12393  
    128128    $blog_name = bp_blogs_get_blogmeta( $activity->item_id, 'name' );
    129129
    130     $action = sprintf( __( '%s created the site %s', 'buddypress' ), bp_core_get_userlink( $activity->user_id ), '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>' );
     130    $action = sprintf( esc_html__( '%s created the site %s', 'buddypress' ), bp_core_get_userlink( $activity->user_id ), '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>' );
    131131
    132132    // Legacy filter - requires the BP_Blogs_Blog object.
     
    210210    if ( empty( $post_title ) ) {
    211211        // Defaults to no title.
    212         $post_title = esc_html__( '(no title)', 'buddypress' );
     212        $post_title = __( '(no title)', 'buddypress' );
    213213
    214214        switch_to_blog( $activity->item_id );
     
    231231
    232232    // Build the 'post link' part of the activity action string.
    233     $post_link  = '<a href="' . esc_url( $post_url ) . '">' . $post_title . '</a>';
     233    $post_link  = '<a href="' . esc_url( $post_url ) . '">' . esc_html( $post_title ) . '</a>';
    234234
    235235    $user_link = bp_core_get_userlink( $activity->user_id );
     
    237237    // Build the complete activity action string.
    238238    if ( is_multisite() ) {
    239         $action  = sprintf( __( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), $user_link, $post_link, '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>' );
     239        $action  = sprintf( esc_html__( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), $user_link, $post_link, '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>' );
    240240    } else {
    241         $action  = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), $user_link, $post_link );
     241        $action  = sprintf( esc_html__( '%1$s wrote a new post, %2$s', 'buddypress' ), $user_link, $post_link );
    242242    }
    243243
     
    359359    }
    360360
    361     $post_link = '<a href="' . esc_url( $post_url ) . '">' . $post_title . '</a>';
     361    $post_link = '<a href="' . esc_url( $post_url ) . '">' . esc_html( $post_title ) . '</a>';
    362362    $user_link = bp_core_get_userlink( $activity->user_id );
    363363
    364364    if ( is_multisite() ) {
    365         $action  = sprintf( __( '%1$s commented on the post, %2$s, on the site %3$s', 'buddypress' ), $user_link, $post_link, '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>' );
     365        $action  = sprintf( esc_html__( '%1$s commented on the post, %2$s, on the site %3$s', 'buddypress' ), $user_link, $post_link, '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>' );
    366366    } else {
    367         $action  = sprintf( __( '%1$s commented on the post, %2$s', 'buddypress' ), $user_link, $post_link );
     367        $action  = sprintf( esc_html__( '%1$s commented on the post, %2$s', 'buddypress' ), $user_link, $post_link );
    368368    }
    369369
Note: See TracChangeset for help on using the changeset viewer.