diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index 714fe459..ba0d5792 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -115,7 +115,6 @@ function url_replace_addon_admin(string &$o) */ function url_replace_render(array &$b) { - $replaced = false; $replacements = []; $nitter_server = DI::config()->get('url_replace', 'nitter_server'); @@ -162,7 +161,6 @@ function url_replace_render(array &$b) foreach ($replacements as $server => $replacement) { if (strpos($b['html'], $server) !== false) { $b['html'] = str_replace($server, $replacement, $b['html']); - $replaced = true; } } @@ -170,11 +168,10 @@ function url_replace_render(array &$b) foreach ($twelvefeet_sites as $twelvefeet_site) { if (strpos($b['html'], $twelvefeet_site) !== false) { $b['html'] = str_replace($twelvefeet_site, 'https://12ft.io/' . $twelvefeet_site, $b['html']); - $replaced = true; } } - if ($replaced) { + if (count($replacements) > 0) { $b['html'] .= '
' . DI::l10n()->t('(URL replace addon enabled for X, YouTube, Instagram and some news sites.)') . '
'; } }