0
0

Merge pull request #16 from tjdev-de/DrMaxNix-patch-1

🐛 fix php-warnings on empty search
This commit is contained in:
thetek 2021-12-22 19:59:30 +01:00 committed by GitHub
commit 79d8a92cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,12 +8,12 @@
require(CMS_path("//config/nameserver.php")); //load config file at 'dnswatch/config/nameserver.php' require(CMS_path("//config/nameserver.php")); //load config file at 'dnswatch/config/nameserver.php'
// GET DOMAIN TO SEARCH FOR // // GET DOMAIN TO SEARCH FOR (IF IT IS SET) //
$__domain = base64_decode($_POST["domain"]); $__domain = (isset($_POST["domain"]) ? base64_decode($_POST["domain"]) : NULL);
// CHECK SYNTAX // // CHECK IF SET AND FOR SYNTAX //
if(preg_match("/^([a-z0-9\-]{1,64}\.){1,16}[a-z0-9]{2,}$/", $__domain)){ if($__domain !== NULL and preg_match("/^([a-z0-9\-]{1,64}\.){1,16}[a-z0-9]{2,}$/", $__domain)){
//filter again for security //filter again for security
$__domain = STR_filter($__domain, "abcdefghijklmnopqrstuvwxyz0123456789-."); //remove all chars in $__domain which are not contained in this list $__domain = STR_filter($__domain, "abcdefghijklmnopqrstuvwxyz0123456789-."); //remove all chars in $__domain which are not contained in this list