mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +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:
@@ -97,6 +97,30 @@ class Tests_Formatting_SanitizeTextField extends WP_UnitTestCase {
|
||||
array(),
|
||||
'',
|
||||
),
|
||||
array(
|
||||
array( 1, 2, 'foo' ),
|
||||
'',
|
||||
),
|
||||
array(
|
||||
new WP_Query,
|
||||
'',
|
||||
),
|
||||
array(
|
||||
2,
|
||||
'2',
|
||||
),
|
||||
array(
|
||||
false,
|
||||
'',
|
||||
),
|
||||
array(
|
||||
true,
|
||||
'1',
|
||||
),
|
||||
array(
|
||||
10.1,
|
||||
'10.1',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user