Skip to:
Content

bbPress.org


Ignore:
Timestamp:
10/12/2021 10:05:17 PM (3 years ago)
Author:
johnjamesjacoby
Message:

Users: add some error checking to get_userdata() calls in profile link functions.

This change ensures that when attempting to link to user profiles when the display_name is the inner HTML of the link, that the "Anonymous" alternate is used whenever the user cannot be found.

It also bails early – returning false – if the user account simply does not exist, consistent with upstream calls to bbp_get_user_id(). (Functions calling these functions have a responsibility to appropriately handle boolean return values.)

In branches/2.6, for 2.6.7.

See #3440.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/common/template.php

    r7211 r7213  
    21522152 * @return bool True if match, false if not
    21532153 */
    2154 function bbp_is_query_name( $name = '' )  {
     2154function bbp_is_query_name( $name = '' ) {
    21552155    return (bool) ( bbp_get_query_name() === $name );
    21562156}
     
    21632163 * @return string To return the query var value
    21642164 */
    2165 function bbp_get_query_name()  {
     2165function bbp_get_query_name() {
    21662166    return get_query_var( '_bbp_query_name' );
    21672167}
     
    21742174 * @param string $name What to set the query var to
    21752175 */
    2176 function bbp_set_query_name( $name = '' )  {
     2176function bbp_set_query_name( $name = '' ) {
    21772177    set_query_var( '_bbp_query_name', $name );
    21782178}
Note: See TracChangeset for help on using the changeset viewer.