- Timestamp:
- 04/27/2024 09:27:26 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/bp-notifications-template.php
r13503 r13812 17 17 */ 18 18 function bp_notifications_slug() { 19 echo bp_get_notifications_slug();19 echo esc_url( bp_get_notifications_slug() ); 20 20 } 21 21 /** … … 47 47 */ 48 48 function bp_notifications_permalink( $user_id = 0 ) { 49 echo bp_get_notifications_permalink( $user_id);49 echo esc_url( bp_get_notifications_permalink( $user_id ) ); 50 50 } 51 51 /** … … 89 89 */ 90 90 function bp_notifications_unread_permalink( $user_id = 0 ) { 91 echo bp_get_notifications_unread_permalink( $user_id);91 echo esc_url( bp_get_notifications_unread_permalink( $user_id ) ); 92 92 } 93 93 /** … … 130 130 */ 131 131 function bp_notifications_read_permalink( $user_id = 0 ) { 132 echo bp_get_notifications_read_permalink( $user_id);132 echo esc_url( bp_get_notifications_read_permalink( $user_id ) ); 133 133 } 134 134 /** … … 294 294 */ 295 295 function bp_the_notification_id() { 296 echo bp_get_the_notification_id();296 echo intval( bp_get_the_notification_id() ); 297 297 } 298 298 /** … … 321 321 */ 322 322 function bp_the_notification_item_id() { 323 echo bp_get_the_notification_item_id();323 echo intval( bp_get_the_notification_item_id() ); 324 324 } 325 325 /** … … 348 348 */ 349 349 function bp_the_notification_secondary_item_id() { 350 echo bp_get_the_notification_secondary_item_id();350 echo intval( bp_get_the_notification_secondary_item_id() ); 351 351 } 352 352 /** … … 375 375 */ 376 376 function bp_the_notification_component_name() { 377 echo bp_get_the_notification_component_name();377 echo esc_html( bp_get_the_notification_component_name() ); 378 378 } 379 379 /** … … 402 402 */ 403 403 function bp_the_notification_component_action() { 404 echo bp_get_the_notification_component_action();404 echo esc_html( bp_get_the_notification_component_action() ); 405 405 } 406 406 /** … … 409 409 * @since 1.9.0 410 410 * 411 * @return intName of the action associated with the current notification.411 * @return string Name of the action associated with the current notification. 412 412 */ 413 413 function bp_get_the_notification_component_action() { … … 418 418 * @since 1.9.0 419 419 * 420 * @param int$component_action Name of the action associated with the current notification.420 * @param string $component_action Name of the action associated with the current notification. 421 421 */ 422 422 return apply_filters( 'bp_get_the_notification_component_action', buddypress()->notifications->query_loop->notification->component_action ); … … 429 429 */ 430 430 function bp_the_notification_date_notified() { 431 echo bp_get_the_notification_date_notified();431 echo esc_html( bp_get_the_notification_date_notified() ); 432 432 } 433 433 /** … … 456 456 */ 457 457 function bp_the_notification_time_since() { 458 echo bp_get_the_notification_time_since();458 echo esc_html( bp_get_the_notification_time_since() ); 459 459 } 460 460 /** … … 495 495 */ 496 496 function bp_the_notification_description() { 497 echo bp_get_the_notification_description(); 497 echo wp_kses( 498 bp_get_the_notification_description(), 499 array( 500 'a' => array( 501 'href' => true, 502 'class' => true, 503 ), 504 ) 505 ); 498 506 } 499 507 /** … … 544 552 */ 545 553 function bp_the_notification_mark_read_link( $user_id = 0 ) { 554 // Escaping is made in `bp_get_the_notification_mark_read_link()`. 555 // phpcs:ignore WordPress.Security.EscapeOutput 546 556 echo bp_get_the_notification_mark_read_link( $user_id ); 547 557 } … … 559 569 $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id; 560 570 561 $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' ) );571 $retval = sprintf( '<a href="%1$s" class="mark-read primary">%2$s</a>', esc_url( bp_get_the_notification_mark_read_url( $user_id ) ), esc_html__( 'Read', 'buddypress' ) ); 562 572 563 573 /** … … 598 608 599 609 // Get the notification ID. 600 $id 610 $id = bp_get_the_notification_id(); 601 611 602 612 // Get the args to add to the URL. … … 636 646 */ 637 647 function bp_the_notification_mark_unread_link( $user_id = 0 ) { 648 // Escaping is done in `bp_get_the_notification_mark_unread_link()`. 649 // phpcs:ignore WordPress.Security.EscapeOutput 638 650 echo bp_get_the_notification_mark_unread_link( $user_id ); 639 651 } … … 651 663 $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id; 652 664 653 $retval = sprintf( '<a href="%1$s" class="mark-unread primary bp-tooltip">%2$s</a>', esc_url( bp_get_the_notification_mark_unread_url( $user_id ) ), __( 'Unread', 'buddypress' ) );665 $retval = sprintf( '<a href="%1$s" class="mark-unread primary bp-tooltip">%2$s</a>', esc_url( bp_get_the_notification_mark_unread_url( $user_id ) ), esc_html__( 'Unread', 'buddypress' ) ); 654 666 655 667 /** … … 728 740 */ 729 741 function bp_the_notification_mark_link( $user_id = 0 ) { 742 // Escaping is made in `bp_get_the_notification_mark_read_link()` & `bp_get_the_notification_mark_unread_link()`. 743 // phpcs:ignore WordPress.Security.EscapeOutput 730 744 echo bp_get_the_notification_mark_link( $user_id ); 731 745 } … … 770 784 */ 771 785 function bp_the_notification_delete_link( $user_id = 0 ) { 786 // Escaping is made in `bp_get_the_notification_delete_link()`. 787 // phpcs:ignore WordPress.Security.EscapeOutput 772 788 echo bp_get_the_notification_delete_link( $user_id ); 773 789 } … … 785 801 $user_id = 0 === $user_id ? bp_displayed_user_id() : $user_id; 786 802 787 $retval = sprintf( '<a href="%1$s" class="delete secondary confirm bp-tooltip">%2$s</a>', esc_url( bp_get_the_notification_delete_url( $user_id ) ), __( 'Delete', 'buddypress' ) );803 $retval = sprintf( '<a href="%1$s" class="delete secondary confirm bp-tooltip">%2$s</a>', esc_url( bp_get_the_notification_delete_url( $user_id ) ), esc_html__( 'Delete', 'buddypress' ) ); 788 804 789 805 /** … … 868 884 */ 869 885 function bp_the_notification_action_links( $args = '' ) { 886 // phpcs:ignore WordPress.Security.EscapeOutput 870 887 echo bp_get_the_notification_action_links( $args ); 871 888 } … … 924 941 */ 925 942 function bp_notifications_pagination_count() { 926 echo bp_get_notifications_pagination_count();943 echo esc_html( bp_get_notifications_pagination_count() ); 927 944 } 928 945 /** … … 963 980 */ 964 981 function bp_notifications_pagination_links() { 982 // Escaping is done in WordPress's `paginate_links()` function. 983 // phpcs:ignore WordPress.Security.EscapeOutput 965 984 echo bp_get_notifications_pagination_links(); 966 985 } … … 1008 1027 1009 1028 <select id="notifications-sort-order-list" name="sort_order" onchange="this.form.submit();"> 1010 <option value="DESC" <?php selected( $selected, 'DESC' ); ?>><?php _e( 'Newest First', 'buddypress' ); ?></option>1011 <option value="ASC" <?php selected( $selected, 'ASC' ); ?>><?php _e( 'Oldest First', 'buddypress' ); ?></option>1029 <option value="DESC" <?php selected( $selected, 'DESC' ); ?>><?php esc_html_e( 'Newest First', 'buddypress' ); ?></option> 1030 <option value="ASC" <?php selected( $selected, 'ASC' ); ?>><?php esc_html_e( 'Oldest First', 'buddypress' ); ?></option> 1012 1031 </select> 1013 1032 … … 1029 1048 <label class="bp-screen-reader-text" for="notification-select"><?php 1030 1049 /* translators: accessibility text */ 1031 _e( 'Select Bulk Action', 'buddypress' );1050 esc_html_e( 'Select Bulk Action', 'buddypress' ); 1032 1051 ?></label> 1033 1052 <select name="notification_bulk_action" id="notification-select"> 1034 <option value="" selected="selected"><?php _e( 'Bulk Actions', 'buddypress' ); ?></option>1053 <option value="" selected="selected"><?php esc_html_e( 'Bulk Actions', 'buddypress' ); ?></option> 1035 1054 1036 1055 <?php if ( bp_is_current_action( 'unread' ) ) : ?> 1037 <option value="read"><?php _e( 'Mark read', 'buddypress' ); ?></option>1056 <option value="read"><?php esc_html_e( 'Mark read', 'buddypress' ); ?></option> 1038 1057 <?php elseif ( bp_is_current_action( 'read' ) ) : ?> 1039 <option value="unread"><?php _e( 'Mark unread', 'buddypress' ); ?></option>1058 <option value="unread"><?php esc_html_e( 'Mark unread', 'buddypress' ); ?></option> 1040 1059 <?php endif; ?> 1041 <option value="delete"><?php _e( 'Delete', 'buddypress' ); ?></option>1060 <option value="delete"><?php esc_html_e( 'Delete', 'buddypress' ); ?></option> 1042 1061 </select> 1043 1062 <input type="submit" id="notification-bulk-manage" class="button action" value="<?php esc_attr_e( 'Apply', 'buddypress' ); ?>">
Note: See TracChangeset
for help on using the changeset viewer.