Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/27/2024 05:51:41 PM (14 months ago)
Author:
imath
Message:

Activity component: improve PHP code standards using WPCS

See #7228 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-feed.php

    r13757 r13816  
    168168            // Check if id is valid.
    169169            if ( empty( $this->id ) ) {
    170                 _doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
     170                _doing_it_wrong( 'BP_Activity_Feed', esc_html__( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
    171171                return false;
    172172            }
     
    318318                if ( 'activity_comment' == bp_get_activity_action_name() ) :
    319319            ?>
    320                 <strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
     320                <strong><?php esc_html_e( 'In reply to', 'buddypress' ) ?></strong> -
    321321                <?php bp_activity_parent_content() ?>
    322322            <?php
     
    414414    protected function output() {
    415415        $this->http_headers();
    416         echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>';
     416        echo '<?xml version="1.0" encoding="' . esc_attr( get_option( 'blog_charset' ) ) . '"?'.'>';
    417417
    418418        /**
     
    440440
    441441<channel>
    442     <title><?php echo $this->title; ?></title>
    443     <link><?php echo $this->link; ?></link>
    444     <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    445     <description><?php echo $this->description ?></description>
    446     <lastBuildDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false ); ?></lastBuildDate>
    447     <generator>https://buddypress.org/?v=<?php bp_version(); ?></generator>
     442    <title><?php echo esc_html( $this->title ); ?></title>
     443    <link><?php echo esc_url( $this->link ); ?></link>
     444    <atom:link href="<?php esc_url( self_link() ); ?>" rel="self" type="application/rss+xml" />
     445    <description><?php echo esc_html( $this->description ); ?></description>
     446    <lastBuildDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false ) ); ?></lastBuildDate>
     447    <generator>https://buddypress.org/?v=<?php esc_html( bp_get_version() ); ?></generator>
    448448    <language><?php bloginfo_rss( 'language' ); ?></language>
    449     <ttl><?php echo $this->ttl; ?></ttl>
    450     <sy:updatePeriod><?php echo $this->update_period; ?></sy:updatePeriod>
    451     <sy:updateFrequency><?php echo $this->update_frequency; ?></sy:updateFrequency>
     449    <ttl><?php echo esc_html( $this->ttl ); ?></ttl>
     450    <sy:updatePeriod><?php echo esc_html( $this->update_period ); ?></sy:updatePeriod>
     451    <sy:updateFrequency><?php echo esc_html( $this->update_frequency ); ?></sy:updateFrequency>
    452452    <?php
    453453
     
    463463            <item>
    464464                <guid isPermaLink="false"><?php bp_activity_feed_item_guid(); ?></guid>
    465                 <title><?php echo stripslashes( bp_get_activity_feed_item_title() ); ?></title>
     465                <title><?php echo esc_html( stripslashes( bp_get_activity_feed_item_title() ) ); ?></title>
    466466                <link><?php bp_activity_thread_permalink() ?></link>
    467                 <pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false ); ?></pubDate>
     467                <pubDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false ) ); ?></pubDate>
    468468
    469469                <?php if ( bp_get_activity_feed_item_description() ) : ?>
Note: See TracChangeset for help on using the changeset viewer.