[wp-trac] [WordPress Trac] #50474: PHP Warning: trim() expects parameter 1 to be string, array given

WordPress Trac noreply at wordpress.org
Thu Jun 25 22:44:05 UTC 2020


#50474: PHP Warning:  trim() expects parameter 1 to be string, array given
--------------------------+-----------------------------
 Reporter:  Darko A7      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Database      |    Version:  5.4.2
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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'] );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50474>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list