Opened 12 days ago
Closed 12 days ago
#50067 closed defect (bug) (duplicate)
Notice if arg passed is an array in author
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.4 |
Component: | Canonical | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
If bots try urls like: /?author[]=1
The following code will give a notice:
Warning: preg_match() expects parameter 2 to be string, array given
} elseif ( is_author() && ! empty( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
Fix:
} elseif ( is_author() && ! empty( $_GET['author'] ) && ! is_array( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
Change History (1)
Note: See
TracTickets for help on using
tickets.
Hi there, welcome back to WordPress Trac!
Thanks for the report, we're already tracking this issue in #17737.