Added comment block with instructions

This commit is contained in:
pezcurrel 2024-10-24 08:03:56 +02:00
parent b375ffd0e5
commit 55a20aea7f

View file

@ -1,5 +1,14 @@
<?php
/*
$tldsregex has to be a string with a list (better if reverse ordered) of valid
tlds separated by "|"; you can get such a list by adding "require gettlds.php"
in the calling script and using it like this:
$tldsre=gettlds($path_to_tlds_cache_file,true);
Then you can pass the list to postLength like this: $length=postLength($post,$tldsre['tlds']);
($tldsre['warnings'] will contain possible gettlds warnings)
*/
function postLength($post,&$tldsregex) {
// echo "-A-> |{$post}|\n";
// for some reason, mastodon seems to check tld existence only on http(s) links - see next regexp