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*/