File: xmlc14n.patch

package info (click to toggle)
simplesamlphp 1.13.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 11,092 kB
  • sloc: php: 65,106; xml: 629; python: 376; sh: 193; perl: 185; makefile: 43
file content (24 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Subject: Add a workaround to canonicalization to address performance
 problems in PHP >= 5.2.
 https://bugs.php.net/bug.php?id=53655
 https://simplesamlphp.org/metaprocessing
Origin: upstream release 1.13.2 
Bug-Debian: http://bugs.debian.org/772121

diff --git a/xmlseclibs.php b/xmlseclibs.php
index 76a14e3..5fc561e 100644
--- a/vendor/robrichards/xmlseclibs/xmlseclibs.php
+++ b/vendor/robrichards/xmlseclibs/xmlseclibs.php
@@ -792,7 +792,11 @@ private function canonicalizeData($node, $canonicalmethod, $arXPath=NULL, $prefi
             }
             return C14NGeneral($node, $exclusive, $withComments);
         }
-        return $node->C14N($exclusive, $withComments, $arXPath, $prefixList);
+        $element = $node;
+        if ($node instanceof DOMNode && $node->ownerDocument !== NULL && $node->isSameNode($node->ownerDocument->documentElement)) {
+            $element = $node->ownerDocument;
+        }
+        return $element->C14N($exclusive, $withComments, $arXPath, $prefixList);
     }
 
     public function canonicalizeSignedInfo() {