Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#50022 closed defect (bug) (duplicate)

Warning: urldecode() expects parameter 1 to be string, array given

Reported by: krypsin's profile krypsin Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Query Keywords: close
Focuses: Cc:

Description

Issue
Sentry has logged an issue here: https://sentry.io/share/issue/22e714bd19904fb29eb54fe8fb3c5f7b/

/wp/wp-includes/class-wp-query.php in WP_Query::get_posts at line 2203

<?php
$q['author'] = addslashes_gpc( '' . urldecode( $q['author'] ) );

Warning: urldecode() expects parameter 1 to be string, array given

This happens on a fresh installation of WordPress.

To replicate

  1. Setup a fresh installation of WordPress (no plugins or anything extra)
  2. Visit the WP URL with the query ?author%5B%5D=%5BFiltered%5D3 to replicate the issue.

Change History (2)

#1 @knutsp
4 years ago

  • Keywords close added
  • Version 5.4 deleted

Hello @krypsin, welcome to Trac and thanks for the ticket.

The author parameter only takes an integer for author_id. For arrays use author__in.

It seems to me the emitted warning is correct.

#2 @SergeyBiryukov
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

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

Note: See TracTickets for help on using tickets.