Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#50067 closed defect (bug) (duplicate)

Notice if arg passed is an array in author

Reported by: malthert Owned by:
Priority: normal Milestone:
Component: Canonical Version: 5.4
Severity: normal Keywords: has-patch
Cc: Focuses:

Description (last modified by SergeyBiryukov)

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)

#1 @SergeyBiryukov
6 years ago

  • Description modified (diff)
  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Hi there, welcome back to WordPress Trac!

Thanks for the report, we're already tracking this issue in #17737.

Note: See TracTickets for help on using tickets.