Fix inverse logic when adding domains on the group management pages.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2021-07-25 19:03:34 +02:00
parent 03920e3595
commit 559150bb1f
3 changed files with 26 additions and 19 deletions

View File

@@ -9,6 +9,7 @@
while (ob_get_level() > 0) {
ob_end_flush();
}
require_once("func.php");
ini_set("output_buffering", "0");
ob_implicit_flush(true);
header('Content-Type: text/event-stream');
@@ -21,16 +22,6 @@ function echoEvent($datatext) {
echo $datatext;
}
// Credit: http://stackoverflow.com/a/4694816/2087442
ini_set("pcre.recursion_limit", 1500);
function validDomain($domain_name)
{
return ($domain_name[0] !== '-' // Don't allow domains to appear as command line options
&& preg_match("/^((-|_)*[a-z\d]((-|_)*[a-z\d])*(-|_)*)(\.(-|_)*([a-z\d]((-|_)*[a-z\d])*))*$/i", $domain_name) // Valid chars check
&& preg_match("/^.{1,253}$/", $domain_name) // Overall length check
&& preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name) ); // Length of each label
}
// Test if domain is set
if(isset($_GET["domain"]))
{