diff --git a/src/parsers/class-wxr-parser-regex.php b/src/parsers/class-wxr-parser-regex.php index b15612ae..9bafa3c3 100644 --- a/src/parsers/class-wxr-parser-regex.php +++ b/src/parsers/class-wxr-parser-regex.php @@ -125,10 +125,10 @@ public function get_tag( $text, $tag ) { if ( substr( $return[1], 0, 9 ) == '' ) !== false ) { preg_match_all( '||s', $return[1], $matches ); - $return = ''; - if ( isset( $matches[1] ) ) { + $return = ''; + if ( isset( $matches[1] ) && is_array( $matches[1] ) ) { foreach ( $matches[1] as $match ) { - $return .= $match; + $return .= $match; } } } else { @@ -322,9 +322,9 @@ public function process_post( $post ) { } public function _normalize_tag( $matches ) { - return '<' . strtolower( $matches[1] ); + $tag = $matches[1] ?? ''; + return '<' . strtolower( $tag ); } - public function fopen( $filename, $mode = 'r' ) { if ( $this->has_gzip ) { return gzopen( $filename, $mode );