@@ -38,9 +38,10 @@ public static function builder($sp, $authnsign = false, $wsign = false, $validUn
3838 $ sls = '' ;
3939
4040 if (isset ($ sp ['singleLogoutService ' ])) {
41+ $ sls_url = htmlspecialchars ($ sp ['singleLogoutService ' ]['url ' ], ENT_QUOTES );
4142 $ sls = <<<SLS_TEMPLATE
4243 <md:SingleLogoutService Binding=" {$ sp ['singleLogoutService ' ]['binding ' ]}"
43- Location=" {$ sp [ ' singleLogoutService ' ][ ' url ' ] }" />
44+ Location=" {$ sls_url }" />
4445
4546SLS_TEMPLATE ;
4647 }
@@ -127,7 +128,7 @@ public static function builder($sp, $authnsign = false, $wsign = false, $validUn
127128 $ reqAttrAuxStr = '> ' ;
128129 if (is_string ($ attribute ['attributeValue ' ])) {
129130 $ attribute ['attributeValue ' ] = array ($ attribute ['attributeValue ' ]);
130- }
131+ }
131132 foreach ($ attribute ['attributeValue ' ] as $ attrValue ) {
132133 $ reqAttrAuxStr .=<<<ATTRIBUTEVALUE
133134
@@ -149,16 +150,18 @@ public static function builder($sp, $authnsign = false, $wsign = false, $validUn
149150METADATA_TEMPLATE ;
150151 }
151152
153+ $ sp_entity_id = htmlspecialchars ($ sp ['entityId ' ], ENT_QUOTES );
154+ $ acs_url = htmlspecialchars ($ sp ['assertionConsumerService ' ]['url ' ], ENT_QUOTES );
152155 $ metadata = <<<METADATA_TEMPLATE
153156<?xml version="1.0"?>
154157<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
155158 validUntil=" {$ validUntilTime }"
156159 cacheDuration="PT {$ cacheDuration }S"
157- entityID=" {$ sp [ ' entityId ' ] }">
160+ entityID=" {$ sp_entity_id }">
158161 <md:SPSSODescriptor AuthnRequestsSigned=" {$ strAuthnsign }" WantAssertionsSigned=" {$ strWsign }" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
159162{$ sls } <md:NameIDFormat> {$ sp ['NameIDFormat ' ]}</md:NameIDFormat>
160163 <md:AssertionConsumerService Binding=" {$ sp ['assertionConsumerService ' ]['binding ' ]}"
161- Location=" {$ sp [ ' assertionConsumerService ' ][ ' url ' ] }"
164+ Location=" {$ acs_url }"
162165 index="1" />
163166 {$ strAttributeConsumingService }
164167 </md:SPSSODescriptor> {$ strOrganization }{$ strContacts }
0 commit comments