Skip to content

Commit

Permalink
Merge pull request #7 from intellihr/fix-sso-error-due-to-deprecation…
Browse files Browse the repository at this point in the history
…-of-disable_entity_loader

Fix sso error due to deprecation of disable_entity_loader
  • Loading branch information
seanmanson authored Oct 18, 2021
2 parents cf20199 + def6706 commit 1fbb22a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
"source": "https://github.com/onelogin/php-saml/"
},
"require": {
"php": ">=5.3.2",
"php": "^8.0.10",
"ext-curl": "*",
"ext-openssl": "*",
"ext-dom": "*",
"ext-mcrypt": "*",
"psr/log": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "4.8",
"phpunit/phpunit": "8.5.19",
"satooshi/php-coveralls": "1.0.1",
"sebastian/phpcpd": "*",
"phploc/phploc": "*",
"pdepend/pdepend" : "1.1.0",
"squizlabs/php_codesniffer": "2.9.0"
"squizlabs/php_codesniffer": "3.6.0"
},
"suggest": {
"ext-gettext": "Install gettext and php5-gettext libs to handle translations"
Expand Down
4 changes: 0 additions & 4 deletions lib/Saml2/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ public static function loadXML($dom, $xml)
throw new Exception('Detected use of ENTITY in XML, disabled to prevent XXE/XEE attacks');
}

$oldEntityLoader = libxml_disable_entity_loader(true);
$res = $dom->loadXML($xml);
libxml_disable_entity_loader($oldEntityLoader);

if (!$res) {
return false;
Expand Down Expand Up @@ -131,9 +129,7 @@ public static function validateXML($xml, $schema, $debug = false)
}

$schemaFile = __DIR__.'/schemas/' . $schema;
$oldEntityLoader = libxml_disable_entity_loader(false);
$res = $dom->schemaValidate($schemaFile);
libxml_disable_entity_loader($oldEntityLoader);
if (!$res) {
$xmlErrors = libxml_get_errors();
syslog(LOG_INFO, 'Error validating the metadata: '.var_export($xmlErrors, true));
Expand Down

0 comments on commit 1fbb22a

Please sign in to comment.