]> git.mxchange.org Git - friendica-addons.git/commitdiff
Fix PHP warning and use quotes
authorDr. Tobias Quathamer <toddy@debian.org>
Mon, 8 Jan 2024 09:36:21 +0000 (10:36 +0100)
committerDr. Tobias Quathamer <toddy@debian.org>
Mon, 8 Jan 2024 09:36:21 +0000 (10:36 +0100)
url_replace/url_replace.php

index 51bc10fe88d5303a9ed3fe4e5c6fd7e5868750a7..4c61b6c2154c6109f452322b92ea1dac2495e739 100644 (file)
@@ -71,7 +71,7 @@ function url_replace_addon_admin(string &$o)
                        $twelvefeet_sites,
                        DI::l10n()->t('Specify the URLs with protocol, one per line.'),
                        null,
-                       'rows=6'
+                       'rows="6"'
                ],
                '$submit' => DI::l10n()->t('Save settings'),
        ]);
@@ -113,6 +113,9 @@ function url_replace_render(array &$b)
        }
 
        $twelvefeet_sites = DI::config()->get('url_replace', 'twelvefeet_sites');
+       if (empty($twelvefeet_sites)) {
+               $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']);