diff --git a/nitter/nitter.php b/nitter/nitter.php index ed587777..1e2c59c3 100644 --- a/nitter/nitter.php +++ b/nitter/nitter.php @@ -1,7 +1,7 @@ * @@ -55,23 +55,23 @@ function nitter_addon_admin(string &$o) } /* - * replace "twitter.com" an "x.com" with "nitter.net" + * replace "twitter.com" and "x.com" with "nitter.net" */ function nitter_render(array &$b) { // this needs to be a system setting $replaced = false; $nitter = DI::config()->get('nitter', 'server', 'https://nitter.net'); - if (strstr($b['html'], 'https://mobile.twitter.com')) { - $b['html'] = str_replace('https://mobile.twitter.com', $nitter, $b['html']); + if (strstr($b['html'], 'https://mobile.twitter.com/')) { + $b['html'] = str_replace('https://mobile.twitter.com/', $nitter, $b['html']); $replaced = true; } - if (strstr($b['html'], 'https://twitter.com')) { - $b['html'] = str_replace('https://twitter.com', $nitter, $b['html']); + if (strstr($b['html'], 'https://twitter.com/')) { + $b['html'] = str_replace('https://twitter.com/', $nitter, $b['html']); $replaced = true; } - if (strstr($b['html'], 'https://x.com')) { - $b['html'] = str_replace('https://x.com', $nitter, $b['html']); + if (strstr($b['html'], 'https://x.com/')) { + $b['html'] = str_replace('https://x.com/', $nitter, $b['html']); $replaced = true; } if ($replaced) {