diff --git a/CHANGELOG.md b/CHANGELOG.md
index bdb869d5e..a409682b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@
- Added `m4a` extension support in M3U playback [\#1724](https://github.com/torrentpier/torrentpier/pull/1724) ([belomaxorka](https://github.com/belomaxorka))
- Created `VersionHelper.php` [\#1731](https://github.com/torrentpier/torrentpier/pull/1731) ([belomaxorka](https://github.com/belomaxorka))
- Drop Ocelot announcer support 🫡 [\#1727](https://github.com/torrentpier/torrentpier/pull/1727) ([belomaxorka](https://github.com/belomaxorka))
+- Replaced some `html_entity_decode` to engine's built-in function [\#1733](https://github.com/torrentpier/torrentpier/pull/1733) ([belomaxorka](https://github.com/belomaxorka))
- Show torrent's announcers list in `filelist.php` page [\#1708](https://github.com/torrentpier/torrentpier/pull/1708) ([belomaxorka](https://github.com/belomaxorka))
- [PHP 8.4] Fixed some deprecations [\#1718](https://github.com/torrentpier/torrentpier/pull/1718) ([belomaxorka](https://github.com/belomaxorka))
- [Configurable] Show magnet-links for guests [\#1712](https://github.com/torrentpier/torrentpier/pull/1712) ([belomaxorka](https://github.com/belomaxorka))
diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php
index 6714e2892..a823ccecb 100644
--- a/library/includes/init_bb.php
+++ b/library/includes/init_bb.php
@@ -361,10 +361,10 @@ function commify(?float $num, int $decimals = 0, ?string $decimal_separator = '.
*
* @param string $string
* @param int $flags
- * @param string|null $encoding
+ * @param string $encoding
* @return string
*/
-function html_ent_decode(string $string, int $flags = ENT_QUOTES, ?string $encoding = 'UTF-8'): string
+function html_ent_decode(string $string, int $flags = ENT_QUOTES, string $encoding = 'UTF-8'): string
{
return html_entity_decode($string, $flags, $encoding);
}
diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php
index 7ca7698a9..d9f77558e 100644
--- a/src/Legacy/Torrent.php
+++ b/src/Legacy/Torrent.php
@@ -644,7 +644,7 @@ class Torrent
// Send torrent
$output = Bencode::encode($tor);
- $dl_fname = html_entity_decode($topic_title, ENT_QUOTES, 'UTF-8') . ' [' . $bb_cfg['server_name'] . '-' . $topic_id . ']' . '.' . TORRENT_EXT;
+ $dl_fname = html_ent_decode($topic_title) . ' [' . $bb_cfg['server_name'] . '-' . $topic_id . ']' . '.' . TORRENT_EXT;
if (!empty($_COOKIE['explain'])) {
$out = "attach path: $filename
";