diff --git a/app/call_block/call_block.php b/app/call_block/call_block.php index d0307f0cdf..d8ca6d88d5 100644 --- a/app/call_block/call_block.php +++ b/app/call_block/call_block.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2019 the Initial Developer. All Rights Reserved. Contributor(s): @@ -101,7 +101,7 @@ //prepare to page the results $sql = "select count(*) from view_call_block "; $sql .= "where domain_uuid = :domain_uuid "; - if (!permission_exists('call_block_all') && count($_SESSION['user']['extension']) > 0) { + if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension'] && count($_SESSION['user']['extension']) > 0)) { $sql .= "and extension_uuid in ("; $x = 0; foreach ($_SESSION['user']['extension'] as $field) { @@ -131,7 +131,7 @@ //get the list $sql = "select * from view_call_block "; $sql .= "where domain_uuid = :domain_uuid "; - if (!permission_exists('call_block_all') && count($_SESSION['user']['extension']) > 0) { + if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension'] && count($_SESSION['user']['extension']) > 0)) { $sql .= "and extension_uuid in ("; $x = 0; foreach ($_SESSION['user']['extension'] as $field) {