Skip to content

Commit 48e4738

Browse files
committed
Pass encoding from context into full processor
1 parent f9b5bea commit 48e4738

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/wp-includes/html-api/class-wp-html-processor.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
293293
* @return static|null The created processor if successful, otherwise null.
294294
*/
295295
public static function create_fragment( $html, $context = '<body>', $encoding = 'UTF-8' ) {
296-
if ( 'UTF-8' !== $encoding ) {
297-
return null;
298-
}
299-
300-
$context_processor = static::create_full_parser( "<!DOCTYPE html>{$context}" );
296+
$context_processor = static::create_full_parser( "<!DOCTYPE html>{$context}", $encoding );
301297
if ( null === $context_processor ) {
302298
return null;
303299
}

0 commit comments

Comments
 (0)