mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-24 11:03:41 +00:00
Simplify providing a default empty array
This commit is contained in:
parent
f3bddaf7d6
commit
1bcd23f684
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ function url_replace_addon_admin(string &$o)
|
||||||
{
|
{
|
||||||
$nitter_server = DI::config()->get('url_replace', 'nitter_server');
|
$nitter_server = DI::config()->get('url_replace', 'nitter_server');
|
||||||
$invidious_server = DI::config()->get('url_replace', 'invidious_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/');
|
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/url_replace/');
|
||||||
$o = Renderer::replaceMacros($t, [
|
$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) {
|
foreach ($twelvefeet_sites as $twelvefeet_site) {
|
||||||
if (strpos($b['html'], $twelvefeet_site) !== false) {
|
if (strpos($b['html'], $twelvefeet_site) !== false) {
|
||||||
$b['html'] = str_replace($twelvefeet_site, 'https://12ft.io/' . $twelvefeet_site, $b['html']);
|
$b['html'] = str_replace($twelvefeet_site, 'https://12ft.io/' . $twelvefeet_site, $b['html']);
|
||||||
|
|
Loading…
Reference in a new issue