Fix scrutinizer

This commit is contained in:
Laurent Destailleur 2021-11-07 18:59:11 +01:00
parent 5085db36a7
commit 1d09ffa4c6
2 changed files with 11 additions and 6 deletions

View File

@ -79,6 +79,7 @@ if ($action == 'update') {
if (!empty($max_rank)) { if (!empty($max_rank)) {
$static_skill = new Skill($db); $static_skill = new Skill($db);
$TAllSkills = $static_skill->fetchAll(); $TAllSkills = $static_skill->fetchAll();
if (is_array($TAllSkills)) {
foreach ($TAllSkills as &$skill) { foreach ($TAllSkills as &$skill) {
if (empty($skill->lines)) $skill->fetchLines(); if (empty($skill->lines)) $skill->fetchLines();
if (count($skill->lines) < $conf->global->HRM_MAXRANK) { if (count($skill->lines) < $conf->global->HRM_MAXRANK) {
@ -86,6 +87,7 @@ if ($action == 'update') {
} }
} }
} }
}
} elseif ($action == 'updateMask') { } elseif ($action == 'updateMask') {
$maskconstorder = GETPOST('maskconstorder', 'alpha'); $maskconstorder = GETPOST('maskconstorder', 'alpha');
$maskorder = GETPOST('maskorder', 'alpha'); $maskorder = GETPOST('maskorder', 'alpha');

View File

@ -851,9 +851,12 @@ if ($action == 'edit') {
$companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); $companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL');
$dnsinfo = false; $dnsinfo = false;
if (!empty($companyemail) && function_exists('dns_get_record')) { if (!empty($companyemail) && function_exists('dns_get_record')) {
$domain = array_pop(explode('@', $companyemail)); $arrayofemailparts = explode('@', $companyemail);
if (count($arrayofemailparts) == 2) {
$domain = $arrayofemailparts[1];
$dnsinfo = dns_get_record($domain, DNS_TXT); $dnsinfo = dns_get_record($domain, DNS_TXT);
} }
}
if (!empty($dnsinfo) && is_array($dnsinfo)) { if (!empty($dnsinfo) && is_array($dnsinfo)) {
foreach ($dnsinfo as $info) { foreach ($dnsinfo as $info) {
if (strpos($info['txt'], 'v=spf') !== false) { if (strpos($info['txt'], 'v=spf') !== false) {