Added comment block with instructions for “postlength”

This commit is contained in:
pezcurrel 2024-10-24 08:09:56 +02:00
parent f33be0fc67
commit ed3dfc93ab

View file

@ -5,6 +5,16 @@
// require gettlds.php in the calling script and use it to set it like this: // require gettlds.php in the calling script and use it to set it like this:
// $retlds=gettlds($path_to_tlds_cache_file,true); // $retlds=gettlds($path_to_tlds_cache_file,true);
/*
Warning: postlength function requires $retlds global variable to be defined.
$retlds 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 like this:
$retlds=gettlds($path_to_tlds_cache_file,true);
$retlds=$retlds['tlds'];
($retlds['warnings'] will contain possible gettlds warnings)
*/
function validtoken($token) { function validtoken($token) {
if (preg_match('#^[A-Za-z0-9_-]{43}$#',$token)===1) if (preg_match('#^[A-Za-z0-9_-]{43}$#',$token)===1)
return true; return true;