Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Cattaneo committed Oct 31, 2018
2 parents 929e44f + fdd5932 commit 2c31cd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/example export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitattributes merge=ours
9 changes: 6 additions & 3 deletions src/Spid/Saml.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public function getSPMetadata(): string
<error>Your SP certificate file is not readable. Please check file permissions.</error>
XML;
}
$entityID = $this->settings['sp_entityid'];

$entityID = htmlspecialchars($this->settings['sp_entityid'], ENT_XML1);
$id = preg_replace('/[^a-z0-9_-]/', '_', $entityID);
$cert = Settings::cleanOpenSsl($this->settings['sp_cert_file']);

Expand All @@ -88,7 +89,8 @@ public function getSPMetadata(): string
</md:KeyDescriptor>
XML;
foreach ($sloLocationArray as $slo) {
$location = $slo[0];

$location = htmlspecialchars($slo[0], ENT_XML1);
$binding = $slo[1];
if (strcasecmp($binding, "POST") === 0 || strcasecmp($binding, "") === 0) {
$binding = Settings::BINDING_POST;
Expand All @@ -105,9 +107,10 @@ public function getSPMetadata(): string
<md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</md:NameIDFormat>
XML;
for ($i = 0; $i < count($assertcsArray); $i++) {
$location = htmlspecialchars($assertcsArray[$i], ENT_XML1);
$xml .= <<<XML
<md:AssertionConsumerService index="$i" isDefault="true" Location="$assertcsArray[$i]" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
<md:AssertionConsumerService index="$i" isDefault="true" Location="$location" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
XML;
}
for ($i = 0; $i < count($attrcsArray); $i++) {
Expand Down

0 comments on commit 2c31cd2

Please sign in to comment.