Created
May 29, 2025 14:57
-
-
Save kagg-design/11e520895121d251cfac48b71c244579 to your computer and use it in GitHub Desktop.
Revisions
-
kagg-design created this gist
May 29, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ /** * Decode HTML entities in a string. * Do it cycle to decode all possible entities, including cases like `<`. * * @since 1.9.2.3 * * @param string $html HTML. * @param int $flags Flags. * @param string|null $encoding Encoding. * * @return string * @noinspection PhpMissingParamTypeInspection */ function wpforms_html_entity_decode_deep( string $html, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, $encoding = null ): string { do { $previous_html = $html; $html = html_entity_decode( $html, $flags, $encoding ); } while ( $html !== $previous_html ); return $html; }