Make WordPress Core

Opened 7 weeks ago

Last modified 6 weeks ago

#63066 new defect (bug)

Warning when array passed to wp_check_invalid_utf8()

Reported by: leedxw's profile leedxw Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.7.2
Component: General Keywords:
Focuses: Cc:

Description

wp_check_invalid_utf8() specifies

 * @param string $text   The text which is to be checked.

and will trigger the following warning if passed an array.

PHP Warning:  Array to string conversion in /var/www/html/wp-includes/formatting.php on line 1096

To reproduce

curl -v "http://localhost/wp-login.php?redirect_to[]=http://"

I would suggest returning an empty string if presented with an array.

Attachments (1)

formatting_array.patch (470 bytes) - added by leedxw 7 weeks ago.
Modify wp_check_invalid_utf8() to return an empty string if passed an array

Download all attachments as: .zip

Change History (2)

@leedxw
7 weeks ago

Modify wp_check_invalid_utf8() to return an empty string if passed an array

Note: See TracTickets for help on using tickets.