Changeset 13467
- Timestamp:
- 04/30/2023 07:54:12 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/11.0/src/bp-activity/classes/class-bp-akismet.php
r12694 r13467 644 644 $history = BP_Akismet::get_activity_history( $item->id ); 645 645 646 if ( empty( $history ) ) 647 return; 648 649 echo '<div class="akismet-history"><div>'; 650 /* translators: 1: the human diff time. 2: the akismet history data. */ 651 printf( _x( '%1$s — %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), '<span>' . bp_core_time_since( $history[2] ) . '</span>', esc_html( $history[1] ) ); 652 echo '</div></div>'; 646 if ( empty( $history ) ) { 647 $message = '—'; 648 } else { 649 /* translators: 1: the human diff time. 2: the akismet history data. */ 650 $message = sprintf( _x( '%1$s — %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), '<span>' . bp_core_time_since( $history['time'] ) . '</span>', esc_html( $history['message'] ) ); 651 } 652 653 printf( '<div class="akismet-history"><div>%s</div></div>', wp_kses( $message, array( 'span' => true ) ) ); 653 654 } 654 655 … … 684 685 public function get_activity_history( $activity_id = 0 ) { 685 686 $history = bp_activity_get_meta( $activity_id, '_bp_akismet_history' ); 686 if ( $history === false ) 687 if ( $history && is_array( $history ) && isset( $history['time'] ) ) { 688 $history['time'] = (int) $history['time']; 689 } else { 687 690 $history = array(); 688 689 // Sort it by the time recorded. 690 usort( $history, 'akismet_cmp_time' ); 691 } 691 692 692 693 return $history;
Note: See TracChangeset
for help on using the changeset viewer.