From 180e80201a66199a2a4854be253ea402c6fb9e38 Mon Sep 17 00:00:00 2001 From: DrMaxNix Date: Wed, 22 Dec 2021 19:43:13 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20php-warnings=20on=20empty?= =?UTF-8?q?=20search?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add fallback for $__domain in line 12 - check for fallback in if in line 16 --- lookup/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lookup/index.php b/lookup/index.php index 73d076c..c9fe385 100644 --- a/lookup/index.php +++ b/lookup/index.php @@ -8,12 +8,12 @@ require(CMS_path("//config/nameserver.php")); //load config file at 'dnswatch/config/nameserver.php' - // GET DOMAIN TO SEARCH FOR // - $__domain = base64_decode($_POST["domain"]); + // GET DOMAIN TO SEARCH FOR (IF IT IS SET) // + $__domain = (isset($_POST["domain"]) ? base64_decode($_POST["domain"]) : NULL); - // CHECK SYNTAX // - if(preg_match("/^([a-z0-9\-]{1,64}\.){1,16}[a-z0-9]{2,}$/", $__domain)){ + // CHECK IF SET AND FOR SYNTAX // + if($__domain !== NULL and preg_match("/^([a-z0-9\-]{1,64}\.){1,16}[a-z0-9]{2,}$/", $__domain)){ //filter again for security $__domain = STR_filter($__domain, "abcdefghijklmnopqrstuvwxyz0123456789-."); //remove all chars in $__domain which are not contained in this list @@ -60,4 +60,4 @@ // RESPOND WITH JSON // echo(json_encode($Response)); -?> \ No newline at end of file +?> -- 2.30.2