Skip to content

Commit ca33f76

Browse files
committed
Early return if the incoming data is not a string
1 parent ee4170b commit ca33f76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wp-admin/includes/export.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ function export_wp( $args = array() ) {
243243
* @return string
244244
*/
245245
function wxr_cdata( $str ) {
246-
$str = (string) $str;
246+
if ( ! is_string( $str ) ) {
247+
return '';
248+
}
247249

248250
if ( ! wp_is_valid_utf8( $str ) ) {
249251
$str = utf8_encode( $str );

0 commit comments

Comments
 (0)