From a3e9c3966d09ede59797ff3fd7a7ceb0be6618b7 Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Thu, 24 Oct 2024 12:23:54 +0200 Subject: [PATCH] Moved TLDs fetching after configuration check --- gancioff | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gancioff b/gancioff index 332c85c..363203c 100755 --- a/gancioff +++ b/gancioff @@ -21,7 +21,6 @@ $ENAME=strtolower($SNAME); $SVERS='0.1'; require __DIR__.'/lib/gettlds.php'; -$tldsregex=gettlds(__DIR__.'/storage/tlds.txt',true); require __DIR__.'/lib/mastodon-postLength.php'; require __DIR__.'/lib/hashtag.php'; require __DIR__.'/lib/html2text.php'; @@ -233,6 +232,8 @@ if (!is_null($conf['max_post_length'])) { echo "Info: got «{$conf['max_post_length']}» as «max_post_length» from configuration file.\n"; } +$tldsregex=gettlds(__DIR__.'/storage/tlds.txt',true); + $url="https://{$conf['fedi_hostname']}/api/v2/instance"; echo "Info: trying to fetch instance info from «{$url}».\n"; $res=curl($url,null,["Authorization: Bearer {$conf['fedi_token']}", 'Accept: application/json']);