diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php index 2e7bae494087aac8047c5a4ac9d24b4eb1c35abc..1bd7299f2fa0620121f98d5bbf1ca25afb52b3e0 100644 --- a/lib/SimpleSAML/Auth/LDAP.php +++ b/lib/SimpleSAML/Auth/LDAP.php @@ -60,8 +60,14 @@ class LDAP * @param int $port * @param bool $referrals */ - public function __construct($hostname, $enable_tls = true, $debug = false, $timeout = 0, $port = 389, $referrals = true) - { + public function __construct( + $hostname, + $enable_tls = true, + $debug = false, + $timeout = 0, + $port = 389, + $referrals = true + ) { // Debug Logger::debug('Library - LDAP __construct(): Setup LDAP with '. 'host=\''.$hostname. @@ -77,7 +83,7 @@ class LDAP * OpenLDAP 2.x.x or Netscape Directory SDK x.x needed for this option. */ if ($debug && !ldap_set_option(null, LDAP_OPT_DEBUG_LEVEL, 7)) { - Logger::warning('Library - LDAP __construct(): Unable to set debug level (LDAP_OPT_DEBUG_LEVEL) to 7'); + Logger::warning('Library - LDAP __construct(): Unable to set debug level (LDAP_OPT_DEBUG_LEVEL) to 7'); } /* @@ -86,18 +92,21 @@ class LDAP */ $resource = @ldap_connect($hostname, $port); if ($resource === false) { - throw $this->makeException('Library - LDAP __construct(): Unable to connect to \''.$hostname.'\'', ERR_INTERNAL); + throw $this->makeException('Library - LDAP __construct(): Unable to connect to \''. + $hostname.'\'', ERR_INTERNAL); } $this->ldap = $resource; // Enable LDAP protocol version 3 if (!@ldap_set_option($this->ldap, LDAP_OPT_PROTOCOL_VERSION, 3)) { - throw $this->makeException('Library - LDAP __construct(): Failed to set LDAP Protocol version (LDAP_OPT_PROTOCOL_VERSION) to 3', ERR_INTERNAL); + throw $this->makeException('Library - LDAP __construct(): Failed to set LDAP Protocol'. + ' version (LDAP_OPT_PROTOCOL_VERSION) to 3', ERR_INTERNAL); } // Set referral option if (!@ldap_set_option($this->ldap, LDAP_OPT_REFERRALS, $referrals)) { - throw $this->makeException('Library - LDAP __construct(): Failed to set LDAP Referrals (LDAP_OPT_REFERRALS) to '.$referrals, ERR_INTERNAL); + throw $this->makeException('Library - LDAP __construct(): Failed to set LDAP Referrals'. + ' (LDAP_OPT_REFERRALS) to '.$referrals, ERR_INTERNAL); } // Set timeouts, if supported @@ -105,17 +114,20 @@ class LDAP $this->timeout = $timeout; if ($timeout > 0) { if (!@ldap_set_option($this->ldap, LDAP_OPT_NETWORK_TIMEOUT, $timeout)) { - Logger::warning('Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_NETWORK_TIMEOUT) to '.$timeout); + Logger::warning('Library - LDAP __construct(): Unable to set timeouts'. + ' (LDAP_OPT_NETWORK_TIMEOUT) to '.$timeout); } if (!@ldap_set_option($this->ldap, LDAP_OPT_TIMELIMIT, $timeout)) { - Logger::warning('Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_TIMELIMIT) to '.$timeout); + Logger::warning('Library - LDAP __construct(): Unable to set timeouts'. + ' (LDAP_OPT_TIMELIMIT) to '.$timeout); } } // Enable TLS, if needed if (stripos($hostname, "ldaps:") === false && $enable_tls) { if (!@ldap_start_tls($this->ldap)) { - throw $this->makeException('Library - LDAP __construct(): Unable to force TLS', ERR_INTERNAL); + throw $this->makeException('Library - LDAP __construct():'. + ' Unable to force TLS', ERR_INTERNAL); } } } @@ -164,7 +176,9 @@ class LDAP } else { if ($errNo !== 0) { $description .= '; cause: \''.ldap_error($this->ldap).'\' (0x'.dechex($errNo).')'; - if (@ldap_get_option($this->ldap, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extendedError) && !empty($extendedError)) { + if (@ldap_get_option($this->ldap, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extendedError) + && !empty($extendedError) + ) { $description .= '; additional: \''.$extendedError.'\''; } } @@ -233,14 +247,15 @@ class LDAP Logger::debug('Library - LDAP search(): Searching base ('.$scope.') \''.$base.'\' for \''.$filter.'\''); if ($scope === 'base') { $result = @ldap_read($this->ldap, $base, $filter, array(), 0, 0, $this->timeout, LDAP_DEREF_NEVER); - } else if ($scope === 'onelevel') { + } elseif ($scope === 'onelevel') { $result = @ldap_list($this->ldap, $base, $filter, array(), 0, 0, $this->timeout, LDAP_DEREF_NEVER); } else { $result = @ldap_search($this->ldap, $base, $filter, array(), 0, 0, $this->timeout, LDAP_DEREF_NEVER); } if ($result === false) { - throw $this->makeException('Library - LDAP search(): Failed search on base \''.$base.'\' for \''.$filter.'\''); + throw $this->makeException('Library - LDAP search(): Failed search on base \''. + $base.'\' for \''.$filter.'\''); } // Sanity checks on search results @@ -249,21 +264,25 @@ class LDAP throw $this->makeException('Library - LDAP search(): Failed to get number of entries returned'); } elseif ($count > 1) { // More than one entry is found. External error - throw $this->makeException('Library - LDAP search(): Found '.$count.' entries searching base \''.$base.'\' for \''.$filter.'\'', ERR_AS_DATA_INCONSIST); + throw $this->makeException('Library - LDAP search(): Found '.$count.' entries searching base \''. + $base.'\' for \''.$filter.'\'', ERR_AS_DATA_INCONSIST); } elseif ($count === 0) { // No entry is fond => wrong username is given (or not registered in the catalogue). User error - throw $this->makeException('Library - LDAP search(): Found no entries searching base \''.$base.'\' for \''.$filter.'\'', ERR_NO_USER); + throw $this->makeException('Library - LDAP search(): Found no entries searching base \''. + $base.'\' for \''.$filter.'\'', ERR_NO_USER); } // Resolve the DN from the search result $entry = @ldap_first_entry($this->ldap, $result); if ($entry === false) { - throw $this->makeException('Library - LDAP search(): Unable to retrieve result after searching base \''.$base.'\' for \''.$filter.'\''); + throw $this->makeException('Library - LDAP search(): Unable to retrieve result after searching base \''. + $base.'\' for \''.$filter.'\''); } $dn = @ldap_get_dn($this->ldap, $entry); if ($dn === false) { - throw $this->makeException('Library - LDAP search(): Unable to get DN after searching base \''.$base.'\' for \''.$filter.'\''); + throw $this->makeException('Library - LDAP search(): Unable to get DN after searching base \''. + $base.'\' for \''.$filter.'\''); } return $dn; } @@ -296,8 +315,14 @@ class LDAP * - $allowZeroHits is FALSE and no result is found * */ - public function searchfordn($base, $attribute, $value, $allowZeroHits = false, $searchFilter = null, $scope = 'subtree') - { + public function searchfordn( + $base, + $attribute, + $value, + $allowZeroHits = false, + $searchFilter = null, + $scope = 'subtree' + ) { // Traverse all search bases, returning DN if found $bases = \SimpleSAML\Utils\Arrays::arrayize($base); foreach ($bases as $current) { @@ -321,8 +346,8 @@ class LDAP return null; } else { // Zero hits not allowed - throw $this->makeException('Library - LDAP searchfordn(): LDAP search returned zero entries for filter \'('. - join(' | ', $attribute).' = '.$value.')\' on base(s) \'('.join(' & ', $bases).')\'', 2); + throw $this->makeException('Library - LDAP searchfordn(): LDAP search returned zero entries for'. + ' filter \'('.join(' | ', $attribute).' = '.$value.')\' on base(s) \'('.join(' & ', $bases).')\'', 2); } } @@ -340,8 +365,14 @@ class LDAP * @param string $scope The scope of the search * @return array */ - public function searchformultiple($bases, $filters, $attributes = array(), $and = true, $escape = true, $scope = 'subtree') - { + public function searchformultiple( + $bases, + $filters, + $attributes = array(), + $and = true, + $escape = true, + $scope = 'subtree' + ) { // Escape the filter values, if requested if ($escape) { $filters = $this->escape_filter_value($filters, false); @@ -728,7 +759,7 @@ class LDAP /** * Convert SASL authz_id into a DN */ - private function authzid_to_dn($searchBase, $searchAttributes, $authz_id) + private function authzidToDn($searchBase, $searchAttributes, $authz_id) { if (preg_match("/^dn:/", $authz_id)) { return preg_replace("/^dn:/", "", $authz_id); @@ -773,7 +804,7 @@ class LDAP $authz_id = $this->authz_id; } - $dn = $this->authzid_to_dn($searchBase, $searchAttributes, $authz_id); + $dn = $this->authzidToDn($searchBase, $searchAttributes, $authz_id); if (!isset($dn) || ($dn == '')) { throw $this->makeException('Cannot figure userID'); diff --git a/lib/SimpleSAML/Auth/ProcessingChain.php b/lib/SimpleSAML/Auth/ProcessingChain.php index 2b1aa72d2579d474964f1b2a51dd09023771b970..b265ccd08588d0717e1278fe4894a4f8ec416b34 100644 --- a/lib/SimpleSAML/Auth/ProcessingChain.php +++ b/lib/SimpleSAML/Auth/ProcessingChain.php @@ -151,7 +151,11 @@ class ProcessingChain throw new \Exception('Authentication processing filter without name given.'); } - $className = \SimpleSAML\Module::resolveClass($config['class'], 'Auth_Process', '\SimpleSAML\Auth\ProcessingFilter'); + $className = \SimpleSAML\Module::resolveClass( + $config['class'], + 'Auth_Process', + '\SimpleSAML\Auth\ProcessingFilter' + ); $config['%priority'] = $priority; unset($config['class']); return new $className($config, null); @@ -202,9 +206,9 @@ class ProcessingChain throw $e; } catch (\Exception $e) { /* - * To be consistent with the exception we return after an redirect, - * we convert this exception before returning it. - */ + * To be consistent with the exception we return after an redirect, + * we convert this exception before returning it. + */ throw new \SimpleSAML\Error\UnserializableException($e); } @@ -247,9 +251,9 @@ class ProcessingChain if (array_key_exists('ReturnURL', $state)) { /* - * Save state information, and redirect to the URL specified - * in $state['ReturnURL']. - */ + * Save state information, and redirect to the URL specified + * in $state['ReturnURL']. + */ $id = State::saveState($state, self::COMPLETED_STAGE); \SimpleSAML\Utils\HTTP::redirectTrustedURL($state['ReturnURL'], array(self::AUTHPARAM => $id)); } else { diff --git a/lib/SimpleSAML/Auth/Source.php b/lib/SimpleSAML/Auth/Source.php index 4569eae3c87ee991b8b7fc4292911d50da8991e8..a7dc11633aadc599a99c7b1daf8de1b297fd7f22 100644 --- a/lib/SimpleSAML/Auth/Source.php +++ b/lib/SimpleSAML/Auth/Source.php @@ -304,7 +304,11 @@ abstract class Source try { // Check whether or not there's a factory responsible for instantiating our Auth Source instance - $factoryClass = \SimpleSAML\Module::resolveClass($id, 'Auth_Source_Factory', '\SimpleSAML\Auth\SourceFactory'); + $factoryClass = \SimpleSAML\Module::resolveClass( + $id, + 'Auth_Source_Factory', + '\SimpleSAML\Auth\SourceFactory' + ); /** @var SourceFactory $factory */ $factory = new $factoryClass; diff --git a/lib/SimpleSAML/AuthMemCookie.php b/lib/SimpleSAML/AuthMemCookie.php index 1c5fb7c967a09684789ee93fd52a59501f4fb564..da3b22f8f2f415778955641335361468919357f3 100644 --- a/lib/SimpleSAML/AuthMemCookie.php +++ b/lib/SimpleSAML/AuthMemCookie.php @@ -120,7 +120,8 @@ class AuthMemCookie $class = class_exists('Memcache') ? '\Memcache' : (class_exists('Memcached') ? '\Memcached' : false); if (!$class) { - throw new \Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.'); + throw new \Exception('Missing Memcached implementation.'. + ' You must install either the Memcache or Memcached extension.'); } // Create the Memcache(d) object. diff --git a/lib/SimpleSAML/Bindings/Shib13/Artifact.php b/lib/SimpleSAML/Bindings/Shib13/Artifact.php index de15f364debee385c01f3a60a54b0fab10f35f86..83df98925eae345cfb143987e1744e40a28dab3d 100644 --- a/lib/SimpleSAML/Bindings/Shib13/Artifact.php +++ b/lib/SimpleSAML/Bindings/Shib13/Artifact.php @@ -140,7 +140,10 @@ class Artifact XML::debugSAMLMessage($request, 'out'); - $url = $idpMetadata->getDefaultEndpoint('ArtifactResolutionService', array('urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding')); + $url = $idpMetadata->getDefaultEndpoint( + 'ArtifactResolutionService', + array('urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding') + ); $url = $url['Location']; $peerPublicKeys = $idpMetadata->getPublicKeys('signing', true); diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php index 7b0ad4543bc6d754a39fd9da2f1c3dc164db9b42..48dc325c52402515da6ebc96a3c7a220eacb6818 100644 --- a/lib/SimpleSAML/Configuration.php +++ b/lib/SimpleSAML/Configuration.php @@ -207,8 +207,11 @@ class Configuration implements Utils\ClearableState * @param string $filename The name of the configuration file. * @param string $configSet The configuration set. Optional, defaults to 'simplesaml'. */ - public static function setPreLoadedConfig(Configuration $config, $filename = 'config.php', $configSet = 'simplesaml') - { + public static function setPreLoadedConfig( + Configuration $config, + $filename = 'config.php', + $configSet = 'simplesaml' + ) { assert(is_string($filename)); assert(is_string($configSet)); diff --git a/lib/SimpleSAML/Memcache.php b/lib/SimpleSAML/Memcache.php index 1752e149e247e2e53a52cc212376531be5ae144e..d0288d9f32c5e32d9921600ab968ecccf514563e 100644 --- a/lib/SimpleSAML/Memcache.php +++ b/lib/SimpleSAML/Memcache.php @@ -306,7 +306,8 @@ class Memcache { $class = class_exists('\Memcache') ? '\Memcache' : (class_exists('\Memcached') ? '\Memcached' : false); if (!$class) { - throw new \Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.'); + throw new \Exception('Missing Memcached implementation.'. + ' You must install either the Memcache or Memcached extension.'); } self::$extension = strtolower($class); diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php index f6f5cdb46d9d4c9bfd9f79b3138456fdf10771e5..e5d18276496e9619f77927681d4e4a70937bbf8d 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php @@ -142,9 +142,9 @@ class MetaDataStorageHandlerPdo extends MetaDataStorageSource return $metadataSet; } - /** + /** * Retrieve a metadata entry. - * + * * @param string $entityId The entityId we are looking up. * @param string $set The set we are looking for metadata in. * @@ -162,7 +162,10 @@ class MetaDataStorageHandlerPdo extends MetaDataStorageSource return null; } - $stmt = $this->db->read("SELECT entity_id, entity_data FROM $tableName WHERE entity_id=:entityId", array('entityId' => $entityId)); + $stmt = $this->db->read( + "SELECT entity_id, entity_data FROM $tableName WHERE entity_id=:entityId", + array('entityId' => $entityId) + ); if ($stmt->execute()) { $rowCount = 0; $data = null; diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php index 7b9d478f5a0c5ac3c84346ec7db03d762a012324..c1c7e6853ea022802f14acdd5ee9002eba15b2c1 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php @@ -130,7 +130,8 @@ class MetaDataStorageHandlerSerialize extends MetaDataStorageSource $dh = @opendir($dir); if ($dh === false) { - \SimpleSAML\Logger::warning('Serialize metadata handler: Unable to open directory: '.var_export($dir, true)); + \SimpleSAML\Logger::warning('Serialize metadata handler: Unable to open directory: '. + var_export($dir, true)); return $ret; } diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageSource.php b/lib/SimpleSAML/Metadata/MetaDataStorageSource.php index 360b619ce95c97c77bb928471a52bbf384d52976..c692b4a709cf4c172d122a6efee798a6bc8293ca 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageSource.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageSource.php @@ -184,8 +184,8 @@ abstract class MetaDataStorageSource } // support discohints in idp metadata for idp discovery - if (array_key_exists('DiscoHints', $entry) - && array_key_exists('IPHint', $entry['DiscoHints']) + if (array_key_exists('DiscoHints', $entry) + && array_key_exists('IPHint', $entry['DiscoHints']) && is_array($entry['DiscoHints']['IPHint'])) { // merge with hints derived from discohints, but prioritize hint.cidr in case it is used $cidrHints = array_merge($entry['DiscoHints']['IPHint'], $cidrHints); diff --git a/lib/SimpleSAML/Metadata/SAMLBuilder.php b/lib/SimpleSAML/Metadata/SAMLBuilder.php index 0c6c7869b42635f5f9a4212d27f8d3ae393523dc..48e1f9454fb006b9428ea2e4bf84ef514a3c44a0 100644 --- a/lib/SimpleSAML/Metadata/SAMLBuilder.php +++ b/lib/SimpleSAML/Metadata/SAMLBuilder.php @@ -321,7 +321,8 @@ class SAMLBuilder * @param array $endpoints The endpoints. * @param bool $indexed Whether the endpoints should be indexed. * - * @return array An array of endpoint objects, either \SAML2\XML\md\EndpointType or \SAML2\XML\md\IndexedEndpointType. + * @return array An array of endpoint objects, + * either \SAML2\XML\md\EndpointType or \SAML2\XML\md\IndexedEndpointType. */ private static function createEndpoints(array $endpoints, $indexed) { diff --git a/lib/SimpleSAML/Metadata/Signer.php b/lib/SimpleSAML/Metadata/Signer.php index eb87586ace868e05f5dc47ec60ab7a5ff96dc35d..195cb02c53b59ab1367159885d0b8987240f86fb 100644 --- a/lib/SimpleSAML/Metadata/Signer.php +++ b/lib/SimpleSAML/Metadata/Signer.php @@ -229,7 +229,8 @@ class Signer $keyFile = \SimpleSAML\Utils\Config::getCertPath($keyCertFiles['privatekey']); if (!file_exists($keyFile)) { - throw new \Exception('Could not find private key file ['.$keyFile.'], which is needed to sign the metadata'); + throw new \Exception('Could not find private key file ['. + $keyFile.'], which is needed to sign the metadata'); } $keyData = file_get_contents($keyFile); diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php index d253408f126c8a550e79f69323b7db8b7a47b2a9..0a830bb44b0fcc583a19d698a2736c794da3e846 100644 --- a/lib/SimpleSAML/Utilities.php +++ b/lib/SimpleSAML/Utilities.php @@ -191,7 +191,7 @@ class Utilities } - private static function _doRedirect($url, $parameters = array()) + private static function doRedirect($url, $parameters = array()) { assert(is_string($url)); assert(!empty($url)); @@ -264,7 +264,7 @@ class Utilities } else { $url = self::normalizeURL($url); } - self::_doRedirect($url, $parameters); + self::doRedirect($url, $parameters); } diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php index 88704151d50bee47b064efb28cbd0da1c5cfd5f1..5cecde3001ddb7a7eae9cb81a636111eb726c50f 100644 --- a/lib/SimpleSAML/Utils/Config/Metadata.php +++ b/lib/SimpleSAML/Utils/Config/Metadata.php @@ -106,7 +106,7 @@ class Metadata // check the type if (!isset($contact['contactType']) || !in_array($contact['contactType'], self::$VALID_CONTACT_TYPES, true)) { $types = join(', ', array_map( - function($t) { + function ($t) { return '"'.$t.'"'; }, self::$VALID_CONTACT_TYPES diff --git a/lib/SimpleSAML/XHTML/TemplateLoader.php b/lib/SimpleSAML/XHTML/TemplateLoader.php index d3a9f853c691beff206109a192ae4059faff58e0..7c0ff97e902c4e6e971320c209db5627dbf4d1dc 100644 --- a/lib/SimpleSAML/XHTML/TemplateLoader.php +++ b/lib/SimpleSAML/XHTML/TemplateLoader.php @@ -58,8 +58,8 @@ class TemplateLoader extends \Twig\Loader\FilesystemLoader $templatedir = $moduledir.'/templates'; if (!is_dir($templatedir)) { throw new \InvalidArgumentException('The module \''.$module.'\' has no templates directory.'); - } return $templatedir; } -} \ No newline at end of file +} + diff --git a/lib/SimpleSAML/XML/Parser.php b/lib/SimpleSAML/XML/Parser.php index b71a8736225455caa29b9ba2e06943be1b971eef..eaf530b643e9e46ebb2ced23471a0d148d1287a5 100644 --- a/lib/SimpleSAML/XML/Parser.php +++ b/lib/SimpleSAML/XML/Parser.php @@ -52,7 +52,8 @@ class Parser $result = $this->simplexml->xpath($xpath); if (!is_array($result) || empty($result)) { if ($required) { - throw new \Exception('Could not get value from XML document using the following XPath expression: '.$xpath); + throw new \Exception('Could not get value from XML document'. + ' using the following XPath expression: '.$xpath); } else { return null; } @@ -69,7 +70,8 @@ class Parser } } if ($required) { - throw new \Exception('Could not get value from XML document using multiple alternative XPath expressions.'); + throw new \Exception('Could not get value from XML document'. + ' using multiple alternative XPath expressions.'); } else { return null; } diff --git a/lib/SimpleSAML/XML/Shib13/AuthnRequest.php b/lib/SimpleSAML/XML/Shib13/AuthnRequest.php index 717e2ff6a637ed0d2daf0e0477b9da103cbdb212..6c4fe7c7b8a710c7460a72fef0bfe74064fe7fdb 100644 --- a/lib/SimpleSAML/XML/Shib13/AuthnRequest.php +++ b/lib/SimpleSAML/XML/Shib13/AuthnRequest.php @@ -39,7 +39,10 @@ class AuthnRequest $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpmetadata = $metadata->getMetaDataConfig($destination, 'shib13-idp-remote'); - $desturl = $idpmetadata->getDefaultEndpoint('SingleSignOnService', array('urn:mace:shibboleth:1.0:profiles:AuthnRequest')); + $desturl = $idpmetadata->getDefaultEndpoint( + 'SingleSignOnService', + array('urn:mace:shibboleth:1.0:profiles:AuthnRequest') + ); $desturl = $desturl['Location']; $target = $this->getRelayState(); diff --git a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php index d10c91fc9a43bcf13139fefe3cd9799961d54f0e..6c8b7e62ffa3d106ceea865a8b1e0828097d172d 100644 --- a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php +++ b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php @@ -119,7 +119,8 @@ class AuthnResponse // Validate against CA $this->validator->validateCA(Config::getCertPath($md->getString('caFile'))); } else { - throw new \SimpleSAML\Error\Exception('Missing certificate in Shibboleth 1.3 IdP Remote metadata for identity provider ['.$issuer.'].'); + throw new \SimpleSAML\Error\Exception('Missing certificate in Shibboleth 1.3'. + ' IdP Remote metadata for identity provider ['.$issuer.'].'); } return true; @@ -233,7 +234,10 @@ class AuthnResponse } } - $attribute_nodes = $this->doXPathQuery('shib:AttributeStatement/shib:Attribute/shib:AttributeValue', $assertion); + $attribute_nodes = $this->doXPathQuery( + 'shib:AttributeStatement/shib:Attribute/shib:AttributeValue', + $assertion + ); /** @var \DOMElement $attribute */ foreach ($attribute_nodes as $attribute) { $value = $attribute->textContent; @@ -418,7 +422,8 @@ class AuthnResponse $scoped = false; } - $attr = '<Attribute AttributeName="'.htmlspecialchars($name).'" AttributeNamespace="urn:mace:shibboleth:1.0:attributeNamespace:uri">'; + $attr = '<Attribute AttributeName="'.htmlspecialchars($name). + '" AttributeNamespace="urn:mace:shibboleth:1.0:attributeNamespace:uri">'; foreach ($values as $value) { $scopePart = ''; if ($scoped) {