mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 04:34:31 +00:00
Formatting: Loosen the type checking in _sanitize_text_fields().
[44618] added strict type checking to `_sanitize_text_fields()`, which has caused some compat issues with plugins. We can loosen the type checking to only reject objects and arrays, and cast other types to string. Props Nick_theGeek, pento. Fixes #41450. git-svn-id: https://develop.svn.wordpress.org/trunk@44731 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5153,10 +5153,12 @@ function sanitize_textarea_field( $str ) {
|
||||
* @return string Sanitized string.
|
||||
*/
|
||||
function _sanitize_text_fields( $str, $keep_newlines = false ) {
|
||||
if ( ! is_string( $str ) ) {
|
||||
if ( is_object( $str ) || is_array( $str ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$str = (string) $str;
|
||||
|
||||
$filtered = wp_check_invalid_utf8( $str );
|
||||
|
||||
if ( strpos( $filtered, '<' ) !== false ) {
|
||||
|
||||
Reference in New Issue
Block a user