mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 02:09:58 +01:00
Fix inverse logic when adding domains on the group management pages.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -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"]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user