diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index df8813f3a3..2b1fba6733 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -58,7 +58,7 @@ //get total extension count from the database, check limit, if defined if ($action == 'add') { - if ($_SESSION['limit']['extensions']['numeric'] != '') { + if (!empty($_SESSION['limit']['extensions']['numeric'])) { $sql = "select count(*) "; $sql .= "from v_extensions "; $sql .= "where domain_uuid = :domain_uuid "; @@ -76,7 +76,7 @@ } //get the http values and set them as php variables - if (count($_POST) > 0) { + if (!empty($_POST) && count($_POST) > 0) { //get the values from the HTTP POST and save them as PHP variables if ($action == 'add' || permission_exists("extension_extension")) { diff --git a/app/extensions/extensions.php b/app/extensions/extensions.php index c553135a22..7be5431c82 100644 --- a/app/extensions/extensions.php +++ b/app/extensions/extensions.php @@ -84,14 +84,14 @@ $order = $_GET["order"] ?? ''; //get total extension count for domain -if (is_numeric($_SESSION['limit']['extensions']['numeric'])) { - $sql = "select count(*) from v_extensions "; - $sql .= "where domain_uuid = :domain_uuid "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $total_extensions = $database->select($sql, $parameters, 'column'); - unset($sql, $parameters); -} + if (isset($_SESSION['limit']['extensions']['numeric'])) { + $sql = "select count(*) from v_extensions "; + $sql .= "where domain_uuid = :domain_uuid "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $database = new database; + $total_extensions = $database->select($sql, $parameters, 'column'); + unset($sql, $parameters); + } //add the search term $search = strtolower($_GET["search"] ?? ''); @@ -177,14 +177,14 @@ if (is_numeric($_SESSION['limit']['extensions']['numeric'])) { echo "