From bddb7f4d49d1f36120b0054d2763aa7c89d03f17 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Mon, 8 Jan 2024 10:36:21 +0100 Subject: [PATCH] Fix PHP warning and use quotes --- 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 51bc10fe..4c61b6c2 100644 --- a/url_replace/url_replace.php +++ b/url_replace/url_replace.php @@ -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']);