Advertisement
fooflington

Patch to get SimpleSAMLphp to cope with BIG XML documents

Sep 7th, 2012
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.40 KB | None | 0 0
  1. # diff -u old/lib/xmlseclibs.php new/lib/xmlseclibs.php
  2. --- old/lib/xmlseclibs.php  2012-08-14 16:17:22.966402523 +0100
  3. +++ new/lib/xmlseclibs.php  2012-09-07 09:29:15.034185999 +0100
  4. @@ -150,11 +150,6 @@
  5.  $withcomments - boolean indicating wether or not to include comments in canonicalized form
  6.  */
  7.  function C14NGeneral($element, $exclusive=FALSE, $withcomments=FALSE) {
  8. -    /* IF PHP 5.2+ then use built in canonical functionality */
  9. -    $php_version = explode('.', PHP_VERSION);
  10. -    if (($php_version[0] > 5) || ($php_version[0] == 5 && $php_version[1] >= 2) ) {
  11. -        return $element->C14N($exclusive, $withcomments);
  12. -    }
  13.  
  14.      /* Must be element or document */
  15.      if (! $element instanceof DOMElement && ! $element instanceof DOMDocument) {
  16. @@ -759,14 +754,11 @@
  17.                  $withComments = TRUE;
  18.                  break;
  19.          }
  20. -/* Support PHP versions < 5.2 not containing C14N methods in DOM extension */
  21. -        $php_version = explode('.', PHP_VERSION);
  22. -        if (($php_version[0] < 5) || ($php_version[0] == 5 && $php_version[1] < 2) ) {
  23. +
  24.              if (! is_null($arXPath)) {
  25.                  throw new Exception("PHP 5.2.0 or higher is required to perform XPath Transformations");
  26.              }
  27.              return C14NGeneral($node, $exclusive, $withComments);
  28. -        }
  29.          return $node->C14N($exclusive, $withComments, $arXPath, $prefixList);
  30.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement