|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-30 10:55 UTC] penny at liip dot ch
[2010-08-06 15:35 UTC] lsmith@php.net
[2010-08-06 18:58 UTC] lsmith@php.net
[2010-08-06 19:45 UTC] dave at dajobe dot org
[2012-07-21 16:12 UTC] jdmadea at gmail dot com
[2013-12-02 13:50 UTC] mike@php.net
-Status: Open
+Status: Not a bug
[2013-12-02 13:50 UTC] mike@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ I have been able to replicate under three environment running Ubuntu LTS php5 (cli, cgi or mod_php), libxslt 1.1.26 and the php5 module and librdf0 and the php5 module. With the above setup, any <xsl:import href="local/file.xsl" /> call will fail with the error XSLTProcessor::importStylesheet(): Local file read for /path/to/local/file.xsl refused Using XSLCache will result in a segfault and no errors. Removing php5's librdf module fixes the issue. Test script: --------------- # a.php <?php ini_set('display_errors', 1); ini_set('error_reporting', E_ALL|E_STRICT|E_NOTICE); //phpinfo(); $doc = new DOMDocument(); $xsl = new XSLTProcessor(); $xsl_filename = __DIR__ . '/collection.xsl'; $xml_filename = __DIR__ . '/collection.xml'; $doc->load($xsl_filename); $xsl->importStyleSheet($doc); $doc->load($xml_filename); echo $xsl->transformToXML($doc); # collection.xml <collection> <cd> <title>Fight for your mind</title> <artist>Ben Harper</artist> <year>1995</year> </cd> <cd> <title>Electric Ladyland</title> <artist>Jimi Hendrix</artist> <year>1997</year> </cd> </collection> # collection.xsl <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="file:///var/www/pgadmin/temp/collection2.xsl" /> <xsl:param name="owner" select="'Nicolas Eliaszewicz'"/> <xsl:output method="html" encoding="iso-8859-1" indent="no"/> <xsl:template match="collection"> Hey! Welcome to <xsl:value-of select="$owner"/>'s sweet CD collection! <xsl:apply-templates/> </xsl:template> <xsl:template match="cd"> <h1><xsl:value-of select="title"/></h1> <h2>by <xsl:value-of select="artist"/> - <xsl:value-of select="year"/></h2> <hr /> </xsl:template> </xsl:stylesheet> # collection2.xsl <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="owner" select="'Nicolas Eliaszewicz'"/> <xsl:output method="html" encoding="iso-8859-1" indent="no"/> <xsl:template match="collection"> Hey! Welcome to <xsl:value-of select="$owner"/>'s sweet CD collection! <xsl:apply-templates/> </xsl:template> <xsl:template match="cd"> <h1><xsl:value-of select="title"/></h1> <h2>by00 <xsl:value-of select="artist"/> - <xsl:value-of select="year"/></h2> <hr /> </xsl:template> </xsl:stylesheet> Expected result: ---------------- A parsed XSLT document with the imported stylesheets. And no errors ;) Actual result: -------------- Warning: XSLTProcessor::importStylesheet(): error in /var/www/temp/a.php on line 14 Call Stack: 0.0002 627304 1. {main}() /var/www/temp/a.php:0 0.0006 631128 2. XSLTProcessor->importStylesheet() /var/www/temp/a.php:14 Warning: XSLTProcessor::importStylesheet(): Local file read for file:///var/www/pgadmin/temp/collection2.xsl refused in /var/www/temp/a.php on line 14 Call Stack: 0.0002 627304 1. {main}() /var/www/temp/a.php:0 0.0006 631128 2. XSLTProcessor->importStylesheet() /var/www/temp/a.php:14