From c43451e7d042bcacec0016036489dcdd47215912 Mon Sep 17 00:00:00 2001 From: r4sas Date: Wed, 29 Jun 2022 18:39:49 +0000 Subject: [PATCH] fix warnings on Add page Signed-off-by: r4sas --- views/add.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/views/add.php b/views/add.php index c2802a6..6314b8e 100644 --- a/views/add.php +++ b/views/add.php @@ -170,10 +170,10 @@ if (isset($_POST["record"]) && !empty($_POST["record"])) { $STH = $pdo->query("SELECT `host`, `base32`, `base64`, `initial`, `disabled` FROM `hosts` WHERE `host` = '" . $domain . "' LIMIT 1"); $row = $STH->fetch(PDO::FETCH_ASSOC); - if(count($row) && !$row['disabled']) { + if($row && !$row['disabled']) { $result["error"] = "Error while validating: That domain is already registered."; - } else if(count($row) && $row['disabled'] && $row['initial']) { + } else if($row && $row['disabled'] && $row['initial']) { $result["error"] = "Error while validating: That domain is reserved and can't be re-registered automatically. Please contact service support team."; } else { @@ -185,7 +185,7 @@ if (isset($_POST["record"]) && !empty($_POST["record"])) { } else { $result["reregister"] = false; - if(count($row) && $row['disabled']) { /* processing disabled domain */ + if($row && $row['disabled']) { /* processing disabled domain */ $log = "[" . date("d-M-Y H:i:s e") . "] Re-registering attempt for " . $row['host'] . "! Next records will be deleted:" . PHP_EOL; /* print all records, which will be deleted*/