From e5cc064200fce223c4d560f84b1def21245b7919 Mon Sep 17 00:00:00 2001 From: Dominik Frantisek Bucik <bucik@ics.muni.cz> Date: Tue, 28 Nov 2023 07:41:35 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Potential=20Undefined=20a?= =?UTF-8?q?rray=20key=20in=20ComputeLoa.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Auth/Process/ComputeLoA.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Auth/Process/ComputeLoA.php b/lib/Auth/Process/ComputeLoA.php index 1b11164..c1f542a 100644 --- a/lib/Auth/Process/ComputeLoA.php +++ b/lib/Auth/Process/ComputeLoA.php @@ -40,7 +40,7 @@ class ComputeLoA extends \SimpleSAML\Auth\ProcessingFilter { parent::__construct($config, $reserved); - if (isset($config['attrName'])) { + if (!empty($config['attrName'])) { $this->attrName = $config['attrName']; } else { $this->attrName = self::DEFAULT_ATTR_NAME; @@ -51,13 +51,13 @@ class ComputeLoA extends \SimpleSAML\Auth\ProcessingFilter { assert('is_array($request)'); - if (isset($request['Attributes'][$this->attrName])) { + if (!empty($request['Attributes'][$this->attrName])) { return; } $this->metadata = MetaDataStorageHandler::getMetadataHandler(); $sourceIdpMeta = $this->metadata->getMetaData($request['saml:sp:IdP'], 'saml20-idp-remote'); - if (isset($sourceIdpMeta['EntityAttributes']['http://macedir.org/entity-category'])) { + if (!empty($sourceIdpMeta['EntityAttributes']['http://macedir.org/entity-category'])) { $entityCategoryAttributes = $sourceIdpMeta['EntityAttributes']['http://macedir.org/entity-category']; } else { Logger::error('cesnet:ComputeLoA - There are no element with name \'EntityAttributes\' ' @@ -66,7 +66,7 @@ class ComputeLoA extends \SimpleSAML\Auth\ProcessingFilter $entityCategoryAttributes = []; } - if (isset($request['Attributes']['eduPersonScopedAffiliation'])) { + if (!empty($request['Attributes']['eduPersonScopedAffiliation'])) { $this->eduPersonScopedAffiliation = $request['Attributes']['eduPersonScopedAffiliation']; } else { Logger::error( -- GitLab