From 1bcd23f6845ffb3836dd32203ac05be85c118c4a Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Wed, 13 Mar 2024 15:39:21 +0100 Subject: [PATCH 01/18] Simplify providing a default empty array --- url_replace/url_replace.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index de16234f..7710a2e1 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -47,7 +47,7 @@ function url_replace_addon_admin(string &$o) { $nitter_server = DI::config()->get('url_replace', 'nitter_server'); $invidious_server = DI::config()->get('url_replace', 'invidious_server'); - $twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites') ?? [] ?: []); + $twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites') ?? []); $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/url_replace/'); $o = Renderer::replaceMacros($t, [ @@ -114,7 +114,7 @@ function url_replace_render(array &$b) } } - $twelvefeet_sites = DI::config()->get('url_replace', 'twelvefeet_sites') ?? [] ?: []; + $twelvefeet_sites = DI::config()->get('url_replace', 'twelvefeet_sites') ?? []; 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']); From a40bd7009b672b869127bc64e87083d0d6eb39de Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Wed, 13 Mar 2024 17:07:08 +0100 Subject: [PATCH 02/18] Add proxigram for instagram redirection. Based on an idea and patch from loma-one. Thanks! --- url_replace/templates/admin.tpl | 1 + url_replace/url_replace.php | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/url_replace/templates/admin.tpl b/url_replace/templates/admin.tpl index b99e6355..01f38e6e 100644 --- a/url_replace/templates/admin.tpl +++ b/url_replace/templates/admin.tpl @@ -1,5 +1,6 @@ {{include file="field_input.tpl" field=$nitter_server}} {{include file="field_input.tpl" field=$invidious_server}} +{{include file="field_input.tpl" field=$proxigram_server}} {{include file="field_textarea.tpl" field=$twelvefeet_sites}}
diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index 7710a2e1..c7bb2e81 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -23,6 +23,7 @@ function url_replace_addon_admin_post() { DI::config()->set('url_replace', 'nitter_server', rtrim(trim($_POST['nitter_server']), '/')); DI::config()->set('url_replace', 'invidious_server', rtrim(trim($_POST['invidious_server']), '/')); + DI::config()->set('url_replace', 'proxigram_server', rtrim(trim($_POST['proxigram_server']), '/')); // Convert twelvefeet_sites into an array before setting the new value $twelvefeet_sites = explode(PHP_EOL, $_POST['twelvefeet_sites']); // Normalize URLs by using lower case, removing a trailing slash and whitespace @@ -41,12 +42,13 @@ function url_replace_addon_admin_post() /** * Hook into admin settings to enable choosing a different server - * for twitter, youtube, and news sites. + * for twitter, youtube, instagram, and news sites. */ function url_replace_addon_admin(string &$o) { $nitter_server = DI::config()->get('url_replace', 'nitter_server'); $invidious_server = DI::config()->get('url_replace', 'invidious_server'); + $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); $twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites') ?? []); $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/url_replace/'); @@ -67,6 +69,14 @@ function url_replace_addon_admin(string &$o) null, 'placeholder="https://yewtu.be"', ], + '$proxigram_server' => [ + 'proxigram_server', + DI::l10n()->t('Proxigram server'), + $proxigram_server, + DI::l10n()->t('Specify the URL with protocol. The default is https://proxigram.lunar.icu.'), + null, + 'placeholder="https://proxigram.lunar.icu"', + ], '$twelvefeet_sites' => [ 'twelvefeet_sites', DI::l10n()->t('Sites which are accessed through 12ft.io'), @@ -96,6 +106,11 @@ function url_replace_render(array &$b) $invidious_server = 'https://yewtu.be'; } + $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); + if (empty($proxigram_server)) { + $proxigram_server = 'https://proxigram.lunar.icu'; + } + // Handle some of twitter and youtube $replacements = [ 'https://mobile.twitter.com' => $nitter_server, @@ -106,6 +121,9 @@ function url_replace_render(array &$b) 'https://youtube.com' => $invidious_server, 'https://m.youtube.com' => $invidious_server, 'https://youtu.be' => $invidious_server, + 'https://www.instagram.com' => $proxigram_server, + 'https://instagram.com' => $proxigram_server, + 'https://ig.me' => $proxigram_server, ]; foreach ($replacements as $server => $replacement) { if (strpos($b['html'], $server) !== false) { @@ -124,6 +142,6 @@ function url_replace_render(array &$b) if ($replaced) { - $b['html'] .= '

' . DI::l10n()->t('(URL replace addon enabled for X, YouTube and some news sites.)') . '

'; + $b['html'] .= '

' . DI::l10n()->t('(URL replace addon enabled for X, YouTube, Instagram and some news sites.)') . '

'; } } From 51797d975b543a8058c359ad2c1252afb20eba9a Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Wed, 13 Mar 2024 17:09:19 +0100 Subject: [PATCH 03/18] Update README --- url_replace/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/url_replace/README.md b/url_replace/README.md index 278de91b..348c4426 100644 --- a/url_replace/README.md +++ b/url_replace/README.md @@ -4,7 +4,8 @@ This addon will replace all occurrences of specified URLs with the address of alternative servers in all displayed postings on a Friendica node. You can use this to switch from Twitter (or X) to a nitter instance, from -YouTube to an invidious instance, or from some news sites to 12ft.io. +YouTube to an invidious instance, from Instagram to a proxigram instance, +or from some news sites to 12ft.io. Note: If you are using the twitter connector on your server, the links to the contacts profile pages will not be replaced by this addon. Only links in the From c6daf2381c4c93cbd006b4d21519798eb0f1170b Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Wed, 13 Mar 2024 22:40:15 +0100 Subject: [PATCH 04/18] Enable individual replacement preferences --- url_replace/templates/admin.tpl | 3 ++ url_replace/url_replace.php | 58 ++++++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/url_replace/templates/admin.tpl b/url_replace/templates/admin.tpl index 01f38e6e..fec5a253 100644 --- a/url_replace/templates/admin.tpl +++ b/url_replace/templates/admin.tpl @@ -1,5 +1,8 @@ +{{include file="field_checkbox.tpl" field=$nitter_server_enabled}} {{include file="field_input.tpl" field=$nitter_server}} +{{include file="field_checkbox.tpl" field=$invidious_server_enabled}} {{include file="field_input.tpl" field=$invidious_server}} +{{include file="field_checkbox.tpl" field=$proxigram_server_enabled}} {{include file="field_input.tpl" field=$proxigram_server}} {{include file="field_textarea.tpl" field=$twelvefeet_sites}} diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index c7bb2e81..7b84a77a 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -21,8 +21,11 @@ function url_replace_install() */ function url_replace_addon_admin_post() { + DI::config()->set('url_replace', 'nitter_server_enabled', !empty($_POST['nitter_server_enabled'])); DI::config()->set('url_replace', 'nitter_server', rtrim(trim($_POST['nitter_server']), '/')); + DI::config()->set('url_replace', 'invidious_server_enabled', !empty($_POST['invidious_server_enabled'])); DI::config()->set('url_replace', 'invidious_server', rtrim(trim($_POST['invidious_server']), '/')); + DI::config()->set('url_replace', 'proxigram_server_enabled', !empty($_POST['proxigram_server_enabled'])); DI::config()->set('url_replace', 'proxigram_server', rtrim(trim($_POST['proxigram_server']), '/')); // Convert twelvefeet_sites into an array before setting the new value $twelvefeet_sites = explode(PHP_EOL, $_POST['twelvefeet_sites']); @@ -46,13 +49,21 @@ function url_replace_addon_admin_post() */ function url_replace_addon_admin(string &$o) { + $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled', true); $nitter_server = DI::config()->get('url_replace', 'nitter_server'); + $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled', true); $invidious_server = DI::config()->get('url_replace', 'invidious_server'); + $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled', true); $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); $twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites') ?? []); $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/url_replace/'); $o = Renderer::replaceMacros($t, [ + '$nitter_server_enabled' => [ + 'nitter_server_enabled', + DI::l10n()->t('Replace links to X.'), + $nitter_server_enabled, + ], '$nitter_server' => [ 'nitter_server', DI::l10n()->t('Nitter server'), @@ -61,6 +72,11 @@ function url_replace_addon_admin(string &$o) null, 'placeholder="https://nitter.net"', ], + '$invidious_server_enabled' => [ + 'invidious_server_enabled', + DI::l10n()->t('Replace links to YouTube.'), + $invidious_server_enabled, + ], '$invidious_server' => [ 'invidious_server', DI::l10n()->t('Invidious server'), @@ -69,6 +85,11 @@ function url_replace_addon_admin(string &$o) null, 'placeholder="https://yewtu.be"', ], + '$proxigram_server_enabled' => [ + 'proxigram_server_enabled', + DI::l10n()->t('Replace links to Instagram.'), + $proxigram_server_enabled, + ], '$proxigram_server' => [ 'proxigram_server', DI::l10n()->t('Proxigram server'), @@ -95,36 +116,49 @@ 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'); if (empty($nitter_server)) { $nitter_server = 'https://nitter.net'; } + $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled', true); + if ($nitter_server_enabled) { + $replacements = array_merge($replacements, [ + 'https://mobile.twitter.com' => $nitter_server, + 'https://twitter.com' => $nitter_server, + 'https://mobile.x.com' => $nitter_server, + 'https://x.com' => $nitter_server, + ]); + } $invidious_server = DI::config()->get('url_replace', 'invidious_server'); if (empty($invidious_server)) { $invidious_server = 'https://yewtu.be'; } + $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled', true); + if ($invidious_server_enabled) { + $replacements = array_merge($replacements, [ + 'https://www.youtube.com' => $invidious_server, + 'https://youtube.com' => $invidious_server, + 'https://m.youtube.com' => $invidious_server, + 'https://youtu.be' => $invidious_server, + ]); + } $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); if (empty($proxigram_server)) { $proxigram_server = 'https://proxigram.lunar.icu'; } - - // Handle some of twitter and youtube - $replacements = [ - 'https://mobile.twitter.com' => $nitter_server, - 'https://twitter.com' => $nitter_server, - 'https://mobile.x.com' => $nitter_server, - 'https://x.com' => $nitter_server, - 'https://www.youtube.com' => $invidious_server, - 'https://youtube.com' => $invidious_server, - 'https://m.youtube.com' => $invidious_server, - 'https://youtu.be' => $invidious_server, + $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled', true); + if ($proxigram_server_enabled) { + $replacements = array_merge($replacements, [ 'https://www.instagram.com' => $proxigram_server, 'https://instagram.com' => $proxigram_server, 'https://ig.me' => $proxigram_server, - ]; + ]); + } + foreach ($replacements as $server => $replacement) { if (strpos($b['html'], $server) !== false) { $b['html'] = str_replace($server, $replacement, $b['html']); From 0bcf2d7c89b437cb86758015cf71bae15bd822ff Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Wed, 13 Mar 2024 22:53:08 +0100 Subject: [PATCH 05/18] Reformat code, no content changes --- url_replace/url_replace.php | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index 7b84a77a..714fe459 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -30,13 +30,13 @@ function url_replace_addon_admin_post() // Convert twelvefeet_sites into an array before setting the new value $twelvefeet_sites = explode(PHP_EOL, $_POST['twelvefeet_sites']); // Normalize URLs by using lower case, removing a trailing slash and whitespace - $twelvefeet_sites = array_map(fn($value): string => rtrim(trim(strtolower($value)), '/'), $twelvefeet_sites); + $twelvefeet_sites = array_map(fn ($value): string => rtrim(trim(strtolower($value)), '/'), $twelvefeet_sites); // Do not store empty lines or duplicates - $twelvefeet_sites = array_filter($twelvefeet_sites, fn($value): bool => !empty($value)); + $twelvefeet_sites = array_filter($twelvefeet_sites, fn ($value): bool => !empty($value)); $twelvefeet_sites = array_unique($twelvefeet_sites); // Ensure a protocol and default to HTTPS $twelvefeet_sites = array_map( - fn($value): string => substr($value, 0, 4) !== 'http' ? 'https://' . $value : $value, + fn ($value): string => substr($value, 0, 4) !== 'http' ? 'https://' . $value : $value, $twelvefeet_sites ); asort($twelvefeet_sites); @@ -50,12 +50,12 @@ function url_replace_addon_admin_post() function url_replace_addon_admin(string &$o) { $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled', true); - $nitter_server = DI::config()->get('url_replace', 'nitter_server'); + $nitter_server = DI::config()->get('url_replace', 'nitter_server'); $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled', true); - $invidious_server = DI::config()->get('url_replace', 'invidious_server'); + $invidious_server = DI::config()->get('url_replace', 'invidious_server'); $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled', true); - $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); - $twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites') ?? []); + $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); + $twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites') ?? []); $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/url_replace/'); $o = Renderer::replaceMacros($t, [ @@ -115,7 +115,7 @@ function url_replace_addon_admin(string &$o) */ function url_replace_render(array &$b) { - $replaced = false; + $replaced = false; $replacements = []; $nitter_server = DI::config()->get('url_replace', 'nitter_server'); @@ -139,10 +139,10 @@ function url_replace_render(array &$b) $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled', true); if ($invidious_server_enabled) { $replacements = array_merge($replacements, [ - 'https://www.youtube.com' => $invidious_server, - 'https://youtube.com' => $invidious_server, - 'https://m.youtube.com' => $invidious_server, - 'https://youtu.be' => $invidious_server, + 'https://www.youtube.com' => $invidious_server, + 'https://youtube.com' => $invidious_server, + 'https://m.youtube.com' => $invidious_server, + 'https://youtu.be' => $invidious_server, ]); } @@ -153,9 +153,9 @@ function url_replace_render(array &$b) $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled', true); if ($proxigram_server_enabled) { $replacements = array_merge($replacements, [ - 'https://www.instagram.com' => $proxigram_server, - 'https://instagram.com' => $proxigram_server, - 'https://ig.me' => $proxigram_server, + 'https://www.instagram.com' => $proxigram_server, + 'https://instagram.com' => $proxigram_server, + 'https://ig.me' => $proxigram_server, ]); } @@ -174,7 +174,6 @@ function url_replace_render(array &$b) } } - if ($replaced) { $b['html'] .= '

' . DI::l10n()->t('(URL replace addon enabled for X, YouTube, Instagram and some news sites.)') . '

'; } From 453772e393dbc36b41d6da33c2547a65ff1d5402 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Wed, 13 Mar 2024 22:54:31 +0100 Subject: [PATCH 06/18] Remove now unnecessary variable --- url_replace/url_replace.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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.)') . '

'; } } From 89134542b4cee865789ad98ce6ff25de8e46d565 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Wed, 13 Mar 2024 22:56:38 +0100 Subject: [PATCH 07/18] Update message catalog --- url_replace/lang/C/messages.po | 42 ++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/url_replace/lang/C/messages.po b/url_replace/lang/C/messages.po index c09ad6d9..72325edf 100644 --- a/url_replace/lang/C/messages.po +++ b/url_replace/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 00:06+0100\n" +"POT-Creation-Date: 2024-03-13 22:56+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,34 +17,56 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: url_replace.php:54 +#: url_replace.php:64 +msgid "Replace links to X." +msgstr "" + +#: url_replace.php:69 msgid "Nitter server" msgstr "" -#: url_replace.php:56 +#: url_replace.php:71 msgid "Specify the URL with protocol. The default is https://nitter.net." msgstr "" -#: url_replace.php:62 +#: url_replace.php:77 +msgid "Replace links to YouTube." +msgstr "" + +#: url_replace.php:82 msgid "Invidious server" msgstr "" -#: url_replace.php:64 +#: url_replace.php:84 msgid "Specify the URL with protocol. The default is https://yewtu.be." msgstr "" -#: url_replace.php:70 +#: url_replace.php:90 +msgid "Replace links to Instagram." +msgstr "" + +#: url_replace.php:95 +msgid "Proxigram server" +msgstr "" + +#: url_replace.php:97 +msgid "" +"Specify the URL with protocol. The default is https://proxigram.lunar.icu." +msgstr "" + +#: url_replace.php:103 msgid "Sites which are accessed through 12ft.io" msgstr "" -#: url_replace.php:72 +#: url_replace.php:105 msgid "Specify the URLs with protocol, one per line." msgstr "" -#: url_replace.php:76 +#: url_replace.php:109 msgid "Save settings" msgstr "" -#: url_replace.php:125 -msgid "(URL replace addon enabled for X, YouTube and some news sites.)" +#: url_replace.php:175 +msgid "" +"(URL replace addon enabled for X, YouTube, Instagram and some news sites.)" msgstr "" From 2cff751b128a906268b504b2bcf88aaa7a2fdec2 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Wed, 13 Mar 2024 22:57:16 +0100 Subject: [PATCH 08/18] Increment version --- url_replace/url_replace.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index ba0d5792..3ab959f0 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -2,7 +2,7 @@ /** * Name: URL Replace * Description: Replaces occurrences of specified URLs with the address of alternative servers in all displays of postings on a node. - * Version: 1.0 + * Version: 1.1 * Author: Dr. Tobias Quathamer * Maintainer: Dr. Tobias Quathamer */ From 890bc3712fbab18581e53c9482eb8fdcd6969963 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Thu, 14 Mar 2024 09:03:12 +0100 Subject: [PATCH 09/18] Use constants for the default servers --- url_replace/url_replace.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index 3ab959f0..3b36b285 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -11,6 +11,10 @@ use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; +CONST URL_REPLACE_NITTER_DEFAULT = 'https://nitter.net'; +CONST URL_REPLACE_INVIDIOUS_DEFAULT = 'https://yewtu.be'; +CONST URL_REPLACE_PROXIGRAM_DEFAULT = 'https://proxigram.lunar.icu'; + function url_replace_install() { Hook::register('prepare_body_final', 'addon/url_replace/url_replace.php', 'url_replace_render'); @@ -68,9 +72,9 @@ function url_replace_addon_admin(string &$o) 'nitter_server', DI::l10n()->t('Nitter server'), $nitter_server, - DI::l10n()->t('Specify the URL with protocol. The default is https://nitter.net.'), + DI::l10n()->t('Specify the URL with protocol. The default is %s.', URL_REPLACE_NITTER_DEFAULT), null, - 'placeholder="https://nitter.net"', + 'placeholder="'.URL_REPLACE_NITTER_DEFAULT.'"', ], '$invidious_server_enabled' => [ 'invidious_server_enabled', @@ -81,9 +85,9 @@ function url_replace_addon_admin(string &$o) 'invidious_server', DI::l10n()->t('Invidious server'), $invidious_server, - DI::l10n()->t('Specify the URL with protocol. The default is https://yewtu.be.'), + DI::l10n()->t('Specify the URL with protocol. The default is %s.', URL_REPLACE_INVIDIOUS_DEFAULT), null, - 'placeholder="https://yewtu.be"', + 'placeholder="'.URL_REPLACE_INVIDIOUS_DEFAULT.'"', ], '$proxigram_server_enabled' => [ 'proxigram_server_enabled', @@ -94,9 +98,9 @@ function url_replace_addon_admin(string &$o) 'proxigram_server', DI::l10n()->t('Proxigram server'), $proxigram_server, - DI::l10n()->t('Specify the URL with protocol. The default is https://proxigram.lunar.icu.'), + DI::l10n()->t('Specify the URL with protocol. The default is %s.', URL_REPLACE_PROXIGRAM_DEFAULT), null, - 'placeholder="https://proxigram.lunar.icu"', + 'placeholder="'.URL_REPLACE_PROXIGRAM_DEFAULT.'"', ], '$twelvefeet_sites' => [ 'twelvefeet_sites', @@ -119,7 +123,7 @@ function url_replace_render(array &$b) $nitter_server = DI::config()->get('url_replace', 'nitter_server'); if (empty($nitter_server)) { - $nitter_server = 'https://nitter.net'; + $nitter_server = URL_REPLACE_NITTER_DEFAULT; } $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled', true); if ($nitter_server_enabled) { @@ -133,7 +137,7 @@ function url_replace_render(array &$b) $invidious_server = DI::config()->get('url_replace', 'invidious_server'); if (empty($invidious_server)) { - $invidious_server = 'https://yewtu.be'; + $invidious_server = URL_REPLACE_INVIDIOUS_DEFAULT; } $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled', true); if ($invidious_server_enabled) { @@ -147,7 +151,7 @@ function url_replace_render(array &$b) $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); if (empty($proxigram_server)) { - $proxigram_server = 'https://proxigram.lunar.icu'; + $proxigram_server = URL_REPLACE_PROXIGRAM_DEFAULT; } $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled', true); if ($proxigram_server_enabled) { From 127ab370fcee9e53970fd8d39a28cc7ca8401067 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Thu, 14 Mar 2024 09:05:34 +0100 Subject: [PATCH 10/18] Update message catalog --- url_replace/lang/C/messages.po | 36 +++++++++++++--------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/url_replace/lang/C/messages.po b/url_replace/lang/C/messages.po index 72325edf..e8dbb04c 100644 --- a/url_replace/lang/C/messages.po +++ b/url_replace/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-13 22:56+0100\n" +"POT-Creation-Date: 2024-03-14 09:05+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,56 +17,48 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: url_replace.php:64 +#: url_replace.php:68 msgid "Replace links to X." msgstr "" -#: url_replace.php:69 +#: url_replace.php:73 msgid "Nitter server" msgstr "" -#: url_replace.php:71 -msgid "Specify the URL with protocol. The default is https://nitter.net." +#: url_replace.php:75 url_replace.php:88 url_replace.php:101 +#, php-format +msgid "Specify the URL with protocol. The default is %s." msgstr "" -#: url_replace.php:77 +#: url_replace.php:81 msgid "Replace links to YouTube." msgstr "" -#: url_replace.php:82 +#: url_replace.php:86 msgid "Invidious server" msgstr "" -#: url_replace.php:84 -msgid "Specify the URL with protocol. The default is https://yewtu.be." -msgstr "" - -#: url_replace.php:90 +#: url_replace.php:94 msgid "Replace links to Instagram." msgstr "" -#: url_replace.php:95 +#: url_replace.php:99 msgid "Proxigram server" msgstr "" -#: url_replace.php:97 -msgid "" -"Specify the URL with protocol. The default is https://proxigram.lunar.icu." -msgstr "" - -#: url_replace.php:103 +#: url_replace.php:107 msgid "Sites which are accessed through 12ft.io" msgstr "" -#: url_replace.php:105 +#: url_replace.php:109 msgid "Specify the URLs with protocol, one per line." msgstr "" -#: url_replace.php:109 +#: url_replace.php:113 msgid "Save settings" msgstr "" -#: url_replace.php:175 +#: url_replace.php:179 msgid "" "(URL replace addon enabled for X, YouTube, Instagram and some news sites.)" msgstr "" From e24e3f758adb8e859bbf9fb2d28bbe5431db3e21 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Thu, 14 Mar 2024 09:31:58 +0100 Subject: [PATCH 11/18] Fix formatting --- url_replace/url_replace.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index 3b36b285..db128f6d 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -11,9 +11,9 @@ use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; -CONST URL_REPLACE_NITTER_DEFAULT = 'https://nitter.net'; -CONST URL_REPLACE_INVIDIOUS_DEFAULT = 'https://yewtu.be'; -CONST URL_REPLACE_PROXIGRAM_DEFAULT = 'https://proxigram.lunar.icu'; +const URL_REPLACE_NITTER_DEFAULT = 'https://nitter.net'; +const URL_REPLACE_INVIDIOUS_DEFAULT = 'https://yewtu.be'; +const URL_REPLACE_PROXIGRAM_DEFAULT = 'https://proxigram.lunar.icu'; function url_replace_install() { From fc33555cd66528c370b901041946c35973ec0674 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Sat, 16 Mar 2024 11:33:48 +0100 Subject: [PATCH 12/18] Remove configuration value if no server URL is provided --- url_replace/url_replace.php | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index db128f6d..1590d3fa 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -26,11 +26,26 @@ function url_replace_install() function url_replace_addon_admin_post() { DI::config()->set('url_replace', 'nitter_server_enabled', !empty($_POST['nitter_server_enabled'])); - DI::config()->set('url_replace', 'nitter_server', rtrim(trim($_POST['nitter_server']), '/')); + $server = rtrim(trim($_POST['nitter_server']), '/'); + if (empty($server)) { + DI::config()->delete('url_replace', 'nitter_server'); + } else { + DI::config()->set('url_replace', 'nitter_server', $server); + } DI::config()->set('url_replace', 'invidious_server_enabled', !empty($_POST['invidious_server_enabled'])); - DI::config()->set('url_replace', 'invidious_server', rtrim(trim($_POST['invidious_server']), '/')); + $server = rtrim(trim($_POST['invidious_server']), '/'); + if (empty($server)) { + DI::config()->delete('url_replace', 'invidious_server'); + } else { + DI::config()->set('url_replace', 'invidious_server', $server); + } DI::config()->set('url_replace', 'proxigram_server_enabled', !empty($_POST['proxigram_server_enabled'])); - DI::config()->set('url_replace', 'proxigram_server', rtrim(trim($_POST['proxigram_server']), '/')); + $server = rtrim(trim($_POST['proxigram_server']), '/'); + if (empty($server)) { + DI::config()->delete('url_replace', 'proxigram_server'); + } else { + DI::config()->set('url_replace', 'proxigram_server', $server); + } // Convert twelvefeet_sites into an array before setting the new value $twelvefeet_sites = explode(PHP_EOL, $_POST['twelvefeet_sites']); // Normalize URLs by using lower case, removing a trailing slash and whitespace @@ -121,10 +136,7 @@ function url_replace_render(array &$b) { $replacements = []; - $nitter_server = DI::config()->get('url_replace', 'nitter_server'); - if (empty($nitter_server)) { - $nitter_server = URL_REPLACE_NITTER_DEFAULT; - } + $nitter_server = DI::config()->get('url_replace', 'nitter_server') ?? URL_REPLACE_NITTER_DEFAULT; $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled', true); if ($nitter_server_enabled) { $replacements = array_merge($replacements, [ @@ -135,10 +147,7 @@ function url_replace_render(array &$b) ]); } - $invidious_server = DI::config()->get('url_replace', 'invidious_server'); - if (empty($invidious_server)) { - $invidious_server = URL_REPLACE_INVIDIOUS_DEFAULT; - } + $invidious_server = DI::config()->get('url_replace', 'invidious_server') ?? URL_REPLACE_INVIDIOUS_DEFAULT; $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled', true); if ($invidious_server_enabled) { $replacements = array_merge($replacements, [ @@ -149,10 +158,7 @@ function url_replace_render(array &$b) ]); } - $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); - if (empty($proxigram_server)) { - $proxigram_server = URL_REPLACE_PROXIGRAM_DEFAULT; - } + $proxigram_server = DI::config()->get('url_replace', 'proxigram_server') ?? URL_REPLACE_PROXIGRAM_DEFAULT; $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled', true); if ($proxigram_server_enabled) { $replacements = array_merge($replacements, [ From a110b2f6c11b9c779825450e30221fd95a3a5199 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Sat, 16 Mar 2024 20:26:38 +0100 Subject: [PATCH 13/18] Reformat code to apply standards --- url_replace/url_replace.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index 1590d3fa..54b407e4 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -89,7 +89,7 @@ function url_replace_addon_admin(string &$o) $nitter_server, DI::l10n()->t('Specify the URL with protocol. The default is %s.', URL_REPLACE_NITTER_DEFAULT), null, - 'placeholder="'.URL_REPLACE_NITTER_DEFAULT.'"', + 'placeholder="' . URL_REPLACE_NITTER_DEFAULT . '"', ], '$invidious_server_enabled' => [ 'invidious_server_enabled', @@ -102,7 +102,7 @@ function url_replace_addon_admin(string &$o) $invidious_server, DI::l10n()->t('Specify the URL with protocol. The default is %s.', URL_REPLACE_INVIDIOUS_DEFAULT), null, - 'placeholder="'.URL_REPLACE_INVIDIOUS_DEFAULT.'"', + 'placeholder="' . URL_REPLACE_INVIDIOUS_DEFAULT . '"', ], '$proxigram_server_enabled' => [ 'proxigram_server_enabled', @@ -115,7 +115,7 @@ function url_replace_addon_admin(string &$o) $proxigram_server, DI::l10n()->t('Specify the URL with protocol. The default is %s.', URL_REPLACE_PROXIGRAM_DEFAULT), null, - 'placeholder="'.URL_REPLACE_PROXIGRAM_DEFAULT.'"', + 'placeholder="' . URL_REPLACE_PROXIGRAM_DEFAULT . '"', ], '$twelvefeet_sites' => [ 'twelvefeet_sites', @@ -136,8 +136,8 @@ function url_replace_render(array &$b) { $replacements = []; - $nitter_server = DI::config()->get('url_replace', 'nitter_server') ?? URL_REPLACE_NITTER_DEFAULT; - $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled', true); + $nitter_server = DI::config()->get('url_replace', 'nitter_server') ?? URL_REPLACE_NITTER_DEFAULT; + $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled') ?? true; if ($nitter_server_enabled) { $replacements = array_merge($replacements, [ 'https://mobile.twitter.com' => $nitter_server, @@ -147,8 +147,8 @@ function url_replace_render(array &$b) ]); } - $invidious_server = DI::config()->get('url_replace', 'invidious_server') ?? URL_REPLACE_INVIDIOUS_DEFAULT; - $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled', true); + $invidious_server = DI::config()->get('url_replace', 'invidious_server') ?? URL_REPLACE_INVIDIOUS_DEFAULT; + $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled') ?? true; if ($invidious_server_enabled) { $replacements = array_merge($replacements, [ 'https://www.youtube.com' => $invidious_server, @@ -158,8 +158,8 @@ function url_replace_render(array &$b) ]); } - $proxigram_server = DI::config()->get('url_replace', 'proxigram_server') ?? URL_REPLACE_PROXIGRAM_DEFAULT; - $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled', true); + $proxigram_server = DI::config()->get('url_replace', 'proxigram_server') ?? URL_REPLACE_PROXIGRAM_DEFAULT; + $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled') ?? true; if ($proxigram_server_enabled) { $replacements = array_merge($replacements, [ 'https://www.instagram.com' => $proxigram_server, From 32f698ce10ac2e790a8723a4a2387b58baacb10a Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Mon, 18 Mar 2024 11:05:09 +0100 Subject: [PATCH 14/18] Only show small info about replacements if the original has changed --- url_replace/url_replace.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index 54b407e4..622ac720 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -134,6 +134,7 @@ 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') ?? URL_REPLACE_NITTER_DEFAULT; @@ -171,6 +172,7 @@ 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; } } @@ -178,10 +180,11 @@ 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 (count($replacements) > 0) { + if ($replaced) { $b['html'] .= '

' . DI::l10n()->t('(URL replace addon enabled for X, YouTube, Instagram and some news sites.)') . '

'; } } From cfbbeaac62bf3c4eaf526824c46e1837055e5a12 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Mon, 18 Mar 2024 11:11:24 +0100 Subject: [PATCH 15/18] Use invidio.us as default --- url_replace/url_replace.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index 622ac720..e5f02412 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -12,7 +12,7 @@ use Friendica\Core\Renderer; use Friendica\DI; const URL_REPLACE_NITTER_DEFAULT = 'https://nitter.net'; -const URL_REPLACE_INVIDIOUS_DEFAULT = 'https://yewtu.be'; +const URL_REPLACE_INVIDIOUS_DEFAULT = 'https://invidio.us'; const URL_REPLACE_PROXIGRAM_DEFAULT = 'https://proxigram.lunar.icu'; function url_replace_install() From 67c44792fd69b5dccc1cd7caf04d86e39e0457f0 Mon Sep 17 00:00:00 2001 From: MrPetovan Date: Tue, 19 Mar 2024 12:56:08 -0400 Subject: [PATCH 16/18] [url_replace] Simplify config setting conditions - Add default values for config values in url_replace_addon_admin() - Capitalize brand names --- url_replace/url_replace.php | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/url_replace/url_replace.php b/url_replace/url_replace.php index e5f02412..cd3b60b4 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -26,25 +26,25 @@ function url_replace_install() function url_replace_addon_admin_post() { DI::config()->set('url_replace', 'nitter_server_enabled', !empty($_POST['nitter_server_enabled'])); - $server = rtrim(trim($_POST['nitter_server']), '/'); - if (empty($server)) { - DI::config()->delete('url_replace', 'nitter_server'); + $nitter_server = rtrim(trim($_POST['nitter_server']), '/'); + if ($nitter_server) { + DI::config()->set('url_replace', 'nitter_server', $nitter_server); } else { - DI::config()->set('url_replace', 'nitter_server', $server); + DI::config()->delete('url_replace', 'nitter_server'); } DI::config()->set('url_replace', 'invidious_server_enabled', !empty($_POST['invidious_server_enabled'])); - $server = rtrim(trim($_POST['invidious_server']), '/'); - if (empty($server)) { - DI::config()->delete('url_replace', 'invidious_server'); + $invidious_server = rtrim(trim($_POST['invidious_server']), '/'); + if ($invidious_server) { + DI::config()->set('url_replace', 'invidious_server', $invidious_server); } else { - DI::config()->set('url_replace', 'invidious_server', $server); + DI::config()->delete('url_replace', 'invidious_server'); } DI::config()->set('url_replace', 'proxigram_server_enabled', !empty($_POST['proxigram_server_enabled'])); - $server = rtrim(trim($_POST['proxigram_server']), '/'); - if (empty($server)) { - DI::config()->delete('url_replace', 'proxigram_server'); + $proxigram_server = rtrim(trim($_POST['proxigram_server']), '/'); + if ($proxigram_server) { + DI::config()->set('url_replace', 'proxigram_server', $proxigram_server); } else { - DI::config()->set('url_replace', 'proxigram_server', $server); + DI::config()->delete('url_replace', 'proxigram_server'); } // Convert twelvefeet_sites into an array before setting the new value $twelvefeet_sites = explode(PHP_EOL, $_POST['twelvefeet_sites']); @@ -64,16 +64,16 @@ function url_replace_addon_admin_post() /** * Hook into admin settings to enable choosing a different server - * for twitter, youtube, instagram, and news sites. + * for Twitter, YouTube, Instagram, and news sites. */ function url_replace_addon_admin(string &$o) { - $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled', true); - $nitter_server = DI::config()->get('url_replace', 'nitter_server'); - $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled', true); - $invidious_server = DI::config()->get('url_replace', 'invidious_server'); - $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled', true); - $proxigram_server = DI::config()->get('url_replace', 'proxigram_server'); + $nitter_server_enabled = DI::config()->get('url_replace', 'nitter_server_enabled') ?? true; + $nitter_server = DI::config()->get('url_replace', 'nitter_server') ?? ''; + $invidious_server_enabled = DI::config()->get('url_replace', 'invidious_server_enabled') ?? true; + $invidious_server = DI::config()->get('url_replace', 'invidious_server') ?? ''; + $proxigram_server_enabled = DI::config()->get('url_replace', 'proxigram_server_enabled') ?? true; + $proxigram_server = DI::config()->get('url_replace', 'proxigram_server') ?? ''; $twelvefeet_sites = implode(PHP_EOL, DI::config()->get('url_replace', 'twelvefeet_sites') ?? []); $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/url_replace/'); From da8681c8c4b914f71ac465858aa2ebb103e81d5b Mon Sep 17 00:00:00 2001 From: MrPetovan Date: Tue, 19 Mar 2024 12:56:08 -0400 Subject: [PATCH 17/18] [invidious] Drop support for the addon - Please use the URL replace addon instead --- invidious/invidious.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/invidious/invidious.php b/invidious/invidious.php index ec16b4dc..1078d26d 100644 --- a/invidious/invidious.php +++ b/invidious/invidious.php @@ -5,7 +5,8 @@ * Version: 0.3 * Author: Matthias Ebers * Author: Michael Vogel - * + * Status: Unsupported + * Note: Please use the URL Replace addon instead */ use Friendica\Core\Hook; @@ -91,7 +92,7 @@ function invidious_render(array &$b) $original = $b['html']; $server = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'invidious', 'server', DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT)); - + $b['html'] = preg_replace("/https?:\/\/www.youtube.com\/watch\?v\=(.*?)/ism", $server . '/watch?v=$1', $b['html']); $b['html'] = preg_replace("/https?:\/\/www.youtube.com\/embed\/(.*?)/ism", $server . '/embed/$1', $b['html']); $b['html'] = preg_replace("/https?:\/\/www.youtube.com\/shorts\/(.*?)/ism", $server . '/shorts/$1', $b['html']); From 872a438dcf18ef6a2925d59abf77520d5800e609 Mon Sep 17 00:00:00 2001 From: MrPetovan Date: Tue, 19 Mar 2024 12:56:08 -0400 Subject: [PATCH 18/18] [nitter] Drop support for the addon - Please use the URL replace addon instead --- nitter/nitter.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nitter/nitter.php b/nitter/nitter.php index e9454c5d..946b18c0 100644 --- a/nitter/nitter.php +++ b/nitter/nitter.php @@ -4,18 +4,20 @@ * Description: Replaces links to twitter.com to a nitter server in all displays of postings on a node. * Version: 2.0 * Author: Tobias Diekershoff + * Status: Unsupported + * Note: Please use the URL Replace addon instead * * Copyright (c) 2020 Tobias Diekershoff * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included in all copies or substantial * portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, @@ -49,7 +51,7 @@ function nitter_addon_admin(string &$o) $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/nitter/'); $o = Renderer::replaceMacros($t, [ '$settingdescription' => DI::l10n()->t('Which nitter server shall be used for the replacements in the post bodies? Use the URL with servername and protocol. See %s for a list of available public Nitter servers.', 'https://github.com/zedeus/nitter/wiki/Instances'), - '$nitterserver' => ['nitterserver', DI::l10n()->t('Nitter server'), $nitterserver, 'https://example.com'], + '$nitterserver' => ['nitterserver', DI::l10n()->t('Nitter server'), $nitterserver, 'https://example.com'], '$submit' => DI::l10n()->t('Save Settings'), ]); }