php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46729 xslt_base_dir parameter doesn't work
Submitted: 2008-12-02 09:29 UTC Modified: 2008-12-16 14:38 UTC
From: gpl at ircf dot fr Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 5.2.6 OS: Linux Ubuntu 8.10
Private report: No CVE-ID: None
 [2008-12-02 09:29 UTC] gpl at ircf dot fr
Description:
------------
Base path cannot be changed by setting the parameter xslt_base_dir in the xslt processor. This bug was also reported here : http://bugs.php.net/bug.php?id=43454&edit=3

Reproduce code:
---------------
<?php
// First, load a XSL stylesheet
$xslDom = DomDocument::loadXML('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:include href="foo"/></xsl:stylesheet>');

// Then initialize the XSLTProcessor
$xsltProcessor = new xsltprocessor();

// Set the xslt_base_dir
$xsltProcessor->setParameter('','xslt_base_dir','base');


// Import the stylesheet in the processor
$xsltProcessor->importStylesheet($xslDom);
?>

Expected result:
----------------
This program should raise the following warning : Failed to load external entity ".../base/foo"

Actual result:
--------------
The program raises the warning : Failed to load external entity ".../foo"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-16 14:38 UTC] rrichards@php.net
That syntax is from the old sablotron extension.
You can set the base directory from a document loaded via memory using:
$xslDom->documentURI = dirname(__FILE__) . '/base/';


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 14:01:30 2024 UTC