File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1098,12 +1098,13 @@ public static function getStatus(DOMDocument $dom)
10981098 *
10991099 * @param DOMElement $encryptedData The encrypted data.
11001100 * @param XMLSecurityKey $inputKey The decryption key.
1101+ * @param bool $formatOutput Format or not the output.
11011102 *
11021103 * @return DOMElement The decrypted element.
11031104 *
11041105 * @throws Exception
11051106 */
1106- public static function decryptElement (DOMElement $ encryptedData , XMLSecurityKey $ inputKey )
1107+ public static function decryptElement (DOMElement $ encryptedData , XMLSecurityKey $ inputKey, $ formatOutput = true )
11071108 {
11081109
11091110 $ enc = new XMLSecEnc ();
@@ -1188,8 +1189,10 @@ public static function decryptElement(DOMElement $encryptedData, XMLSecurityKey
11881189
11891190 $ xml = '<root xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ' .$ decrypted .'</root> ' ;
11901191 $ newDoc = new DOMDocument ();
1191- $ newDoc ->preserveWhiteSpace = false ;
1192- $ newDoc ->formatOutput = true ;
1192+ if ($ formatOutput ) {
1193+ $ newDoc ->preserveWhiteSpace = false ;
1194+ $ newDoc ->formatOutput = true ;
1195+ }
11931196 $ newDoc = self ::loadXML ($ newDoc , $ xml );
11941197 if (!$ newDoc ) {
11951198 throw new ValidationError (
You can’t perform that action at this time.
0 commit comments