44
55namespace SimpleSAML \XHTML ;
66
7+ use Exception ;
78use SimpleSAML \Assert \Assert ;
89use SimpleSAML \Configuration ;
910use SimpleSAML \Logger ;
1011use SimpleSAML \Metadata \MetaDataStorageHandler ;
1112use SimpleSAML \Session ;
1213use SimpleSAML \Utils ;
1314
15+ use function array_fill_keys ;
16+ use function array_intersect_key ;
17+ use function array_intersect ;
18+ use function array_key_exists ;
19+ use function array_keys ;
20+ use function array_merge ;
21+ use function htmlspecialchars ;
22+ use function preg_match ;
23+ use function sizeof ;
24+ use function strcasecmp ;
25+ use function urldecode ;
26+ use function usort ;
27+
1428/**
1529 * This class implements a generic IdP discovery service, for use in various IdP
1630 * discovery service pages. This should reduce code duplication.
@@ -128,7 +142,7 @@ public function __construct(array $metadataSets, string $instance)
128142
129143 // standard discovery service parameters
130144 if (!array_key_exists ('entityID ' , $ _GET )) {
131- throw new \ Exception ('Missing parameter: entityID ' );
145+ throw new Exception ('Missing parameter: entityID ' );
132146 } else {
133147 $ this ->spEntityId = $ _GET ['entityID ' ];
134148 }
@@ -142,7 +156,7 @@ public function __construct(array $metadataSets, string $instance)
142156 $ this ->log ('returnIdParam initially set to [ ' . $ this ->returnIdParam . '] ' );
143157
144158 if (!array_key_exists ('return ' , $ _GET )) {
145- throw new \ Exception ('Missing parameter: return ' );
159+ throw new Exception ('Missing parameter: return ' );
146160 } else {
147161 $ httpUtils = new Utils \HTTP ();
148162 $ this ->returnURL = $ httpUtils ->checkURLAllowed ($ _GET ['return ' ]);
@@ -251,7 +265,7 @@ protected function validateIdP(?string $idp): ?string
251265 try {
252266 $ this ->metadata ->getMetaData ($ idp , $ metadataSet );
253267 return $ idp ;
254- } catch (\ Exception $ e ) {
268+ } catch (Exception $ e ) {
255269 // continue
256270 }
257271 }
@@ -584,7 +598,7 @@ public function handleRequest(): void
584598 $ templateFile = 'selectidp-links.twig ' ;
585599 break ;
586600 default :
587- throw new \ Exception ('Invalid value for the \'idpdisco.layout \' option. ' );
601+ throw new Exception ('Invalid value for the \'idpdisco.layout \' option. ' );
588602 }
589603
590604 $ t = new Template ($ this ->config , $ templateFile );
0 commit comments