Skip to:
Content

BuddyPress.org

Changeset 10817


Ignore:
Timestamp:
05/27/2016 06:05:31 AM (4 years ago)
Author:
r-a-y
Message:

Notifications: Don't use object buffering in template tags.

Use sprintf() instead.

See r7539.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-notifications/bp-notifications-template.php

    r10816 r10817  
    560560        $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
    561561
    562         // Start the output buffer.
    563         ob_start(); ?>
    564 
    565         <a href="<?php bp_the_notification_mark_read_url( $user_id ); ?>" class="mark-read primary"><?php _e( 'Read', 'buddypress' ); ?></a>
    566 
    567         <?php $retval = ob_get_clean();
     562        $retval = sprintf( '<a href="%1$s" class="mark-read primary">%2$s</a>', esc_url( bp_get_the_notification_mark_read_url( $user_id ) ), __( 'Read', 'buddypress' ) );
    568563
    569564        /**
     
    657652        $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
    658653
    659         // Start the output buffer.
    660         ob_start(); ?>
    661 
    662         <a href="<?php bp_the_notification_mark_unread_url( $user_id ); ?>" class="mark-unread primary"><?php _ex( 'Unread',  'Notification screen action', 'buddypress' ); ?></a>
    663 
    664         <?php $retval = ob_get_clean();
     654        $retval = sprintf( '<a href="%1$s" class="mark-unread primary">%2$s</a>', esc_url( bp_get_the_notification_mark_unread_url( $user_id ) ), __( 'Unread', 'buddypress' ) );
    665655
    666656        /**
     
    796786        $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id;
    797787
    798         // Start the output buffer.
    799         ob_start(); ?>
    800 
    801         <a href="<?php bp_the_notification_delete_url(); ?>" class="delete secondary confirm"><?php _e( 'Delete', 'buddypress' ); ?></a>
    802 
    803         <?php $retval = ob_get_clean();
     788        $retval = sprintf( '<a href="%1$s" class="delete secondary confirm">%2$s</a>', esc_url( bp_get_the_notification_delete_url( $user_id ) ), __( 'Delete', 'buddypress' ) );
    804789
    805790        /**
Note: See TracChangeset for help on using the changeset viewer.