Opened 3 years ago
Closed 3 years ago
#3402 closed defect (bug) (fixed)
PHP Notice when calling bbp_get_user_nicename() for non-existent users
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.6.6 | Priority: | normal |
Severity: | normal | Version: | 2.6.0 |
Component: | Component - Users | Keywords: | has-patch |
Cc: |
Description
Most bbPress functions seem to handle a non-existent user being passed ok, but bbp_get_user_nicename()
is not one of them.
PHP Notice: Trying to get property 'user_nicename' of non-object
wp-content/plugins/bbpress/includes/users/template.php:493
The function seems to be designed with the idea that the user might not exist, but it still fails to handle it properly.
See attached patch, which returns false when the userdata can't be found, similar to passing a user_id of 0
.
Attachments (2)
Change History (7)
#2
@
3 years ago
- Owner set to johnjamesjacoby
- Status changed from new to assigned
- Version set to 2.6.0
#3
@
3 years ago
3402.2.diff does the following:
- Does the
force
check first to be more assertive with that argument - Switches from
$user_id
to$r['user_id']
which should be derived from$user_id
but may not be - Falls back to an empty string so filter always applies
Note: See
TracTickets for help on using
tickets.
Refresh with some extra checks