Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/27/2024 06:05:30 PM (2 years ago)
Author:
imath
Message:

Activity component: improve PHP code standards using WPCS

See #7228 (branch 12.0)

File:
1 edited

Legend:

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

    r13582 r13817  
    166166            // Check if id is valid.
    167167            if ( empty( $this->id ) ) {
    168                 _doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
     168                _doing_it_wrong( 'BP_Activity_Feed', esc_html__( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
    169169                return false;
    170170            }
     
    316316                if ( 'activity_comment' == bp_get_activity_action_name() ) :
    317317            ?>
    318                 <strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
     318                <strong><?php esc_html_e( 'In reply to', 'buddypress' ) ?></strong> -
    319319                <?php bp_activity_parent_content() ?>
    320320            <?php
     
    410410    protected function output() {
    411411        $this->http_headers();
    412         echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>';
     412        echo '<?xml version="1.0" encoding="' . esc_attr( get_option( 'blog_charset' ) ) . '"?'.'>';
    413413
    414414        /**
     
    436436
    437437<channel>
    438     <title><?php echo $this->title; ?></title>
    439     <link><?php echo $this->link; ?></link>
    440     <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    441     <description><?php echo $this->description ?></description>
    442     <lastBuildDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false ); ?></lastBuildDate>
    443     <generator>https://buddypress.org/?v=<?php bp_version(); ?></generator>
     438    <title><?php echo esc_html( $this->title ); ?></title>
     439    <link><?php echo esc_url( $this->link ); ?></link>
     440    <atom:link href="<?php esc_url( self_link() ); ?>" rel="self" type="application/rss+xml" />
     441    <description><?php echo esc_html( $this->description ); ?></description>
     442    <lastBuildDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false ) ); ?></lastBuildDate>
     443    <generator>https://buddypress.org/?v=<?php esc_html( bp_get_version() ); ?></generator>
    444444    <language><?php bloginfo_rss( 'language' ); ?></language>
    445     <ttl><?php echo $this->ttl; ?></ttl>
    446     <sy:updatePeriod><?php echo $this->update_period; ?></sy:updatePeriod>
    447     <sy:updateFrequency><?php echo $this->update_frequency; ?></sy:updateFrequency>
     445    <ttl><?php echo esc_html( $this->ttl ); ?></ttl>
     446    <sy:updatePeriod><?php echo esc_html( $this->update_period ); ?></sy:updatePeriod>
     447    <sy:updateFrequency><?php echo esc_html( $this->update_frequency ); ?></sy:updateFrequency>
    448448    <?php
    449449
     
    459459            <item>
    460460                <guid isPermaLink="false"><?php bp_activity_feed_item_guid(); ?></guid>
    461                 <title><?php echo stripslashes( bp_get_activity_feed_item_title() ); ?></title>
     461                <title><?php echo esc_html( stripslashes( bp_get_activity_feed_item_title() ) ); ?></title>
    462462                <link><?php bp_activity_thread_permalink() ?></link>
    463                 <pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false ); ?></pubDate>
     463                <pubDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false ) ); ?></pubDate>
    464464
    465465                <?php if ( bp_get_activity_feed_item_description() ) : ?>
Note: See TracChangeset for help on using the changeset viewer.