diff --git src/wp-includes/formatting.php src/wp-includes/formatting.php
index 54d12c6398..e7525ead12 100644
|
|
function sanitize_textarea_field( $str ) { |
4741 | 4741 | * @return string Sanitized string. |
4742 | 4742 | */ |
4743 | 4743 | function _sanitize_text_fields( $str, $keep_newlines = false ) { |
| 4744 | if ( !is_string($str) ) { |
| 4745 | return ''; |
| 4746 | } |
4744 | 4747 | $filtered = wp_check_invalid_utf8( $str ); |
4745 | 4748 | |
4746 | 4749 | if ( strpos($filtered, '<') !== false ) { |
diff --git tests/phpunit/tests/formatting/SanitizeTextField.php tests/phpunit/tests/formatting/SanitizeTextField.php
index be470ce2e8..6b1c689394 100644
|
|
class Tests_Formatting_SanitizeTextField extends WP_UnitTestCase { |
93 | 93 | 'Nested octects %%%ABABAB %A%A%ABBB', |
94 | 94 | 'Nested octects', |
95 | 95 | ), |
| 96 | array( |
| 97 | array(), |
| 98 | '', |
| 99 | ), |
96 | 100 | ); |
97 | 101 | } |
98 | 102 | |