Remove now unnecessary variable

This commit is contained in:
Dr. Tobias Quathamer 2024-03-13 22:54:31 +01:00 committed by Hypolite Petovan
parent 0bcf2d7c89
commit 453772e393

View file

@ -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'] .= '<hr><p><small>' . DI::l10n()->t('(URL replace addon enabled for X, YouTube, Instagram and some news sites.)') . '</small></p>';
}
}