diff --git a/api/index.php b/api/index.php index aaea660..6ba8e81 100644 --- a/api/index.php +++ b/api/index.php @@ -254,7 +254,7 @@ function setCompanyForUser($ID, $REQ, $replace = false) { $another_user_companies = getCompaniesForUser($admin_to_remove_id, $existed_client_record['ID']); - if(count($another_user_companies) === 0) + if(gettype($another_user_companies) === "array" && count($another_user_companies) === 0) { \CUser::Delete($admin_to_remove_id); } @@ -1098,7 +1098,7 @@ switch($PARAM_1) { $user_companies = getCompaniesForUser($removed_user_id); - if(count($user_companies) === 0) + if(gettype($user_companies) === "array" && count($user_companies) === 0) { \CUser::Delete($removed_user_id); } @@ -2449,7 +2449,7 @@ switch($PARAM_1) $questions_ar_res['PROPERTIES'] = $questions_ob_element->GetProperties(); $templates = []; - if(count($questions_ar_res['PROPERTIES']['TEMPLATE_FILE']['VALUE']) > 0) + if(gettype($questions_ar_res['PROPERTIES']['TEMPLATE_FILE']['VALUE']) === "array" && count($questions_ar_res['PROPERTIES']['TEMPLATE_FILE']['VALUE']) > 0) { foreach($questions_ar_res['PROPERTIES']['TEMPLATE_FILE']['VALUE'] AS $file_id) { @@ -2474,7 +2474,7 @@ switch($PARAM_1) "title" => $questions_ar_res['NAME'], "answer" => $questions_ar_res['PREVIEW_TEXT'], "request" => $questions_ar_res['PROPERTIES']['REQUEST']['VALUE_XML_ID'] == "YES" ? true : false, - "templates" => count($templates) > 0 ? $templates : null, + "templates" => gettype($templates) === "array" && count($templates) > 0 ? $templates : null, "documents" => $questions_ar_res['PROPERTIES']['DOCUMENTS']['~VALUE'] !== "" ? $questions_ar_res['PROPERTIES']['DOCUMENTS']['~VALUE']['TEXT'] : null, ]; diff --git a/local/components/evolution/catalog.city.team/templates/.default/template.php b/local/components/evolution/catalog.city.team/templates/.default/template.php index d3b8f38..6d149a1 100644 --- a/local/components/evolution/catalog.city.team/templates/.default/template.php +++ b/local/components/evolution/catalog.city.team/templates/.default/template.php @@ -12,7 +12,7 @@ /** @var CBitrixComponent $component */ $this->setFrameMode(true); ?> - if(count($arResult['LEADER']) > 0): ?> + if($arResult['LEADER'] !== null && count($arResult['LEADER']) > 0): ?>