Ticket #3440: 3440.patch
File 3440.patch, 3.1 KB (added by , 3 years ago) |
---|
-
src/includes/common/template.php
2151 2151 * 2152 2152 * @return bool True if match, false if not 2153 2153 */ 2154 function bbp_is_query_name( $name = '' ) 2154 function bbp_is_query_name( $name = '' ) { 2155 2155 return (bool) ( bbp_get_query_name() === $name ); 2156 2156 } 2157 2157 … … 2162 2162 * 2163 2163 * @return string To return the query var value 2164 2164 */ 2165 function bbp_get_query_name() 2165 function bbp_get_query_name() { 2166 2166 return get_query_var( '_bbp_query_name' ); 2167 2167 } 2168 2168 … … 2173 2173 * 2174 2174 * @param string $name What to set the query var to 2175 2175 */ 2176 function bbp_set_query_name( $name = '' ) 2176 function bbp_set_query_name( $name = '' ) { 2177 2177 set_query_var( '_bbp_query_name', $name ); 2178 2178 } 2179 2179 -
src/includes/extend/buddypress/activity.php
384 384 } 385 385 386 386 // User link for topic author 387 $user_link = bbp_get_user_profile_link( $user_id 387 $user_link = bbp_get_user_profile_link( $user_id ); 388 388 389 389 // Topic 390 390 $topic_permalink = bbp_get_topic_permalink( $topic_id ); … … 519 519 } 520 520 521 521 // Setup links for activity stream 522 $user_link = bbp_get_user_profile_link( $user_id 522 $user_link = bbp_get_user_profile_link( $user_id ); 523 523 524 524 // Reply 525 525 $reply_url = bbp_get_reply_url( $reply_id ); -
src/includes/users/template.php
444 444 return false; 445 445 } 446 446 447 $user = get_userdata( $user_id ); 448 $user_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 447 // Get the user 448 $user = get_userdata( $user_id ); 449 if ( empty( $user ) ) { 450 return false; 451 } 449 452 453 // Display Name 454 $name = ! empty( $user->display_name ) 455 ? $user->display_name 456 : bbp_get_fallback_display_name(); 457 458 // URL 459 $url = bbp_get_user_profile_url( $user_id ); 460 461 // Link 462 $link = ! empty( $url ) 463 ? '<a href="' . esc_url( $url ) . '">' . esc_html( $name ) . '</a>' 464 : esc_html( $name ); 465 450 466 // Filter & return 451 return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id );467 return (string) apply_filters( 'bbp_get_user_profile_link', $link, $user_id ); 452 468 } 453 469 454 470 /** … … 596 612 return false; 597 613 } 598 614 599 $user = get_userdata( $user_id ); 600 $edit_link = '<a href="' . esc_url( bbp_get_user_profile_edit_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 615 // Get the user 616 $user = get_userdata( $user_id ); 617 if ( empty( $user ) ) { 618 return false; 619 } 601 620 621 // Display Name 622 $name = ! empty( $user->display_name ) 623 ? $user->display_name 624 : bbp_get_fallback_display_name(); 625 626 // URL 627 $url = bbp_get_user_profile_edit_url( $user_id ); 628 629 // Link 630 $link = ! empty( $url ) 631 ? '<a href="' . esc_url( $url ) . '">' . esc_html( $name ) . '</a>' 632 : esc_html( $name ); 633 602 634 // Filter & return 603 return apply_filters( 'bbp_get_user_profile_edit_link', $edit_link, $user_id );635 return (string) apply_filters( 'bbp_get_user_profile_edit_link', $link, $user_id ); 604 636 } 605 637 606 638 /**