|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesvnrauwlc (last revision 2015-07-16 12:07 UTC by sample at email dot tst)blqcykmi (last revision 2015-07-16 12:02 UTC by sample at email dot tst) tgoeylwo (last revision 2015-07-16 11:56 UTC by sample at email dot tst) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-06-23 10:33 UTC] tamerlaha at gmail dot com
[2020-08-31 16:00 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2020-08-31 16:00 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ Script should return nothing if validation was successful. With libxml_disable_entity_loader(False) it works as expected. with libxml_disable_entity_loader(true); Raise "failed to load external entity." and validation fails. why is schema considered like external entity? Test script: --------------- <?php libxml_use_internal_errors(true); libxml_disable_entity_loader(true); $contents = file_get_contents("zbx_screens_export.xml"); $xml = new DOMDocument(); if(!$xml->loadXML($contents)){ $errors = libxml_get_errors(); print_r ($errors);}; $result = $xml->relaxNGValidate("screens.rng"); if(!$result){ $errors = libxml_get_errors(); print_r ($errors); }; ?> screens.rng http://pastebin.com/QTV6MHaw zbx_screens_export.xml http://pastebin.com/AkcpLzwn Actual result: -------------- PHP Warning: DOMDocument::relaxNGValidate(): Invalid RelaxNG in /home/tamerlan/relaxng.php on line 11 Array ( [0] => LibXMLError Object ( [level] => 1 [code] => 1549 [column] => 0 [message] => failed to load external entity "screens.rng" [file] => [line] => 0 ) [1] => LibXMLError Object ( [level] => 2 [code] => 1065 [column] => 0 [message] => xmlRelaxNGParse: could not load screens.rng [file] => [line] => 0 ) )