#27130 closed defect (bug) (fixed)
Credentials parameter default in wp_signon() should be an array
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch |
Focuses: | Cc: |
Description
* @param array $credentials Optional. User info in order to sign on. * @param bool $secure_cookie Optional. Whether to use secure cookie. * @return object Either WP_Error on failure, or WP_User on success. */ function wp_signon( $credentials = '', $secure_cookie = '' ) {
@return WP_User|WP_Error Either WP_Error on failure, or WP_User on success.
$credentials = '', $secure_cookie = ''
probably wrong default values. Or wrong@param
Attachments (1)
Change History (10)
#1
@
7 years ago
- Component changed from General to Users
- Focuses docs added
- Milestone changed from Awaiting Review to 3.9
#4
in reply to:
↑ 3
@
7 years ago
Replying to DrewAPicture:
@tivnet: Care to make a patch? :)
I usually do. In this case, there were unclear moments (see Sergey's comments)
If what Sergey wrote is final - I'll make a patch...
...or you can just fix that :-), and I'll lose the "props" this time :-)))
#5
@
7 years ago
- Keywords has-patch added; needs-patch removed
Ticket #26148 has patch addresses this issue.
#6
@
7 years ago
- Milestone 3.9 deleted
- Resolution set to duplicate
- Status changed from new to closed
Duplicate of #26148.
#7
@
7 years ago
- Focuses docs removed
- Milestone set to 3.9
- Resolution duplicate deleted
- Status changed from closed to reopened
#26148 is a documentation-specific patch. Re-opening here in favor of handling the $credentials
default change from an empty string to an empty array.
Note: See
TracTickets for help on using
tickets.
Seems like the default value of
$credentials
should be an array.We use strict comparison for
$secure_cookie
though:https://core.trac.wordpress.org/browser/tags/3.8.1/src/wp-includes/user.php#L43
Could probably use
null
instead, but need to be careful with backwards compatibility, so I guess it's safer to keep it a string. The@param
description is correct, it's treated as a boolean value.