Fixed bug: “rsort” was applied to “$tlds”, now it is correctly applied to “$tlds['tlds']”

This commit is contained in:
pezcurrel 2024-10-24 08:15:08 +02:00
parent ed3dfc93ab
commit 318eb07409

View file

@ -23,7 +23,7 @@ $debug='';
require 'lib/gettlds.php'; require 'lib/gettlds.php';
$tlds=gettlds('storage/tlds.txt',false);// we don't get them in "regex format" because we need them for js too, so we'll rsort them later $tlds=gettlds('storage/tlds.txt',false);// we don't get them in "regex format" because we need them for js too, so we'll rsort them later
if (!is_null($tlds['warnings'])) $debug.="GetTLDs warning: {$tlds['warnings']}.<br>\n"; if (!is_null($tlds['warnings'])) $debug.="GetTLDs warning: {$tlds['warnings']}.<br>\n";
rsort($tlds); rsort($tlds['tlds']);
$retlds=implode('|',$tlds['tlds']); $retlds=implode('|',$tlds['tlds']);
$jstlds="const tlds=['".implode("', '",$tlds['tlds'])."'];\n"; $jstlds="const tlds=['".implode("', '",$tlds['tlds'])."'];\n";
$jstldsfp='storage/tlds.js'; $jstldsfp='storage/tlds.js';