Moved TLDs fetching after configuration check

This commit is contained in:
pezcurrel 2024-10-24 12:23:54 +02:00
parent be8a18897e
commit a3e9c3966d

View file

@ -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']);