Skip to content

Commit

Permalink
Replace deprecated utf8_decode with mb_convert_encoding (#26)
Browse files Browse the repository at this point in the history
* Replace deprecated utf8_decode with mb_convert_encoding

* CS

* Switched utf8 encoding like upstream
  • Loading branch information
derpaschi authored Sep 24, 2024
1 parent 4e1e085 commit 95fc513
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function add_anchor_attribute( string $html ): string {

libxml_use_internal_errors( true );
$dom = new \DOMDocument();
$dom->loadHTML( $html_wo_nbs, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
$dom->loadHTML( '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $html_wo_nbs, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );

// use xpath to select the Heading html tags.
$xpath = new \DOMXPath( $dom );
Expand All @@ -432,7 +432,7 @@ function add_anchor_attribute( string $html ): string {
}

// Save the HTML changes.
$content = utf8_decode( $dom->saveHTML( $dom->documentElement ) ); //phpcs:ignore
$content = $dom->saveHTML( $dom->documentElement ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase

return $content;
}
Expand Down

0 comments on commit 95fc513

Please sign in to comment.