Opened 16 months ago
Last modified 16 months ago
#62276 assigned defect (bug)
class-wp-user.php can throw a warning for trim() when $value is null
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 6.7 |
| Component: | General | Keywords: | has-patch |
| Focuses: | coding-standards, php-compatibility | Cc: |
Description
It seems like the class-wp-user.php class can throw a deprecated warning on the trim() function when $value is null.
Change History (3)
This ticket was mentioned in PR #7612 on WordPress/wordpress-develop by chrisd1997.
16 months ago
#1
- Keywords has-patch added
#2
follow-up:
↓ 3
@
16 months ago
If $value is null when docs day @param string|int then the error is correct. Why silence it?
#3
in reply to:
↑ 2
@
16 months ago
Replying to knutsp:
If
$valueis null when docs day@param string|intthen the error is correct. Why silence it?
I don't think we should allow it to go through to a function that will throw a deprecation error either. I'd say we'd rather have it return false then.
Note: See
TracTickets for help on using
tickets.
Moved the
nullcheck above the usage of$value, as this could benull. If the$valueisnull, a deprecation warning will be thrown for thetrim()function.Trac ticket: https://core.trac.wordpress.org/ticket/62276