|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-12-02 09:30 UTC] r3wald at gmail dot com
[2013-12-02 13:32 UTC] mike@php.net
-Status: Open
+Status: Feedback
[2013-12-02 13:32 UTC] mike@php.net
[2013-12-02 13:56 UTC] r3wald at gmail dot com
[2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 23:00:02 2025 UTC |
Description: ------------ Somewhere between 5.3.0 and 5.3.2, the security model for XSL has been over tightened. XSL stylesheets which refer to other stylesheet by <xsl:import> or <xsl:include> now fail to work. Test script: --------------- <?php // PHP 5.3.2 XSLT BUG - <xsl:import> (and <xsl:include>) are broken $aDOM= new DOMDocument(); $aDOM->loadXML('<?xml version="1.0"?><etc/>'); $stylesheet= new DOMDocument(); $proc= new XSLTProcessor(); $stylesheet->loadXML('<?xml version="1.0"?><stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform"><import href="somesheet.xslt"/><template match="/"/></stylesheet>'); $proc->importStyleSheet($stylesheet); $oops= $proc->transformToDoc($aDOM); ?> Expected result: ---------------- Assuming there is a valid stylesheet at "somesheet.xslt", the transform should work as per the W3C spec. Am I missing something? Is there, for example, a way to set this security default somewhere? Or a class method for XSLTProcessor to disable this? Actual result: -------------- Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: error in /home/robin/f2f/hardcode/xsl-import.php on line 10 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: Local file read for /home/robin/f2f/hardcode/somesheet.xslt refused in /home/robin/f2f/hardcode/xsl-import.php on line 10 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: error in /home/robin/f2f/hardcode/xsl-import.php on line 10 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: xsl:import: read rights for /home/robin/f2f/hardcode/somesheet.xslt denied in /home/robin/f2f/hardcode/xsl-import.php on line 10 Warning: XSLTProcessor::transformToDoc() [xsltprocessor.transformtodoc]: No stylesheet associated to this object in /home/robin/f2f/hardcode/xsl-import.php on line 11