Changeset 44731
- Timestamp:
- 02/07/2019 11:34:22 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r44714 r44731 5154 5154 */ 5155 5155 function _sanitize_text_fields( $str, $keep_newlines = false ) { 5156 if ( ! is_string( $str ) ) {5156 if ( is_object( $str ) || is_array( $str ) ) { 5157 5157 return ''; 5158 5158 } 5159 5160 $str = (string) $str; 5159 5161 5160 5162 $filtered = wp_check_invalid_utf8( $str ); -
trunk/tests/phpunit/tests/formatting/SanitizeTextField.php
r44618 r44731 98 98 '', 99 99 ), 100 array( 101 array( 1, 2, 'foo' ), 102 '', 103 ), 104 array( 105 new WP_Query, 106 '', 107 ), 108 array( 109 2, 110 '2', 111 ), 112 array( 113 false, 114 '', 115 ), 116 array( 117 true, 118 '1', 119 ), 120 array( 121 10.1, 122 '10.1', 123 ), 100 124 ); 101 125 }
Note: See TracChangeset
for help on using the changeset viewer.