WordPress.org

Make WordPress Core

#50474 closed defect (bug) (duplicate)

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

Reported by: Darko A7 Owned by:
Milestone: Priority: normal
Severity: minor Version: 5.4.2
Component: Query Keywords:
Focuses: Cc:

Description

Hi,

I noticed few lines in my logs, not sure if generated warning is just on purpose, or missed check on php side:

access log:

31.145.214.139 - - [26/Jun/2020:00:09:26 +0200] "POST /mysql-root-?q=user%2Fpassword&name%5B%23post_render%5D%5B%5D=passthru&name%5B%23type%5D=markup&name%5B%23markup%5D=id HTTP/1.1" 200 17221

error log:

[Fri Jun 26 00:09:26.942439 2020] [:error] [pid 13725] [client 31.145.214.139:55140] PHP Warning:  trim() expects parameter 1 to be string, array given in /.../wp-includes/class-wp-query.php on line 777

code @ L777:

public function parse_query( $query = '' ) {

(...)

$qv['name']     = trim( $qv['name'] );

Change History (1)

#1 @SergeyBiryukov
12 months ago

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

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.