Bugs php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login

go to bug id or search bugs for

Bug #29837 disable-output-escaping = "yes", ignored
Submitted: 2004年08月25日 16:37 UTC Modified: 2004年12月14日 12:18 UTC
Votes:11
Avg. Score:4.9 ± 0.3
Reproduced:9 of 9 (100.0%)
Same Version:6 (66.7%)
Same OS:6 (66.7%)
From: tetsuo at scriptsphp dot org Assigned:
Status: Closed Package: XSLT related
PHP Version: 5.0.1 OS: Linux
Private report: No CVE-ID: None
[2004年08月25日 16:37 UTC] tetsuo at scriptsphp dot org
Description:
------------
CDATA sections in XSL templates
that are enclosed
in <xsl:text disable-output-escaping="yes"> give output
that IS escaped but shouldn't be.
I've been testing the transformation with xsltproc and
everything behaves correctly.
libxslt Version 	1.1.6 
libxslt compiled against libxml Version 	2.6.9
Reproduce code:
---------------
http://tetsuo.scriptsphp.net:81/XsltTest.php
http://tetsuo.scriptsphp.net:81/xslttest/test.xsl
http://tetsuo.scriptsphp.net:81/xslttest/test.xml
Expected result:
----------------
... &nbsp; ...
Actual result:
--------------
... &amp;nbsp; ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
[2004年08月27日 09:27 UTC] chregu@php.net
I'll try to have a look at it, when my time permits...
[2004年09月06日 15:53 UTC] plumber at gnu-darwin dot org
this example like other produces a seg fault
################
new XsltProcessor
################
php 5.0.1-darwin
XSL 
enabled 
libxslt Version 
1.1.8 
libxslt compiled against libxml Version 
2.6.11 
EXSLT 
enabled 
libexslt Version 1.1.8
[2004年10月12日 18:45 UTC] gantonet at free dot fr
Same problem with PHP 5.0.2 version for Windows
Here's what I get from phpinfo()
PHP API 20031224 
PHP Extension 20040412 
Zend Extension 220040412 
xml
XML Support active 
XML Namespace Support active 
libxml2 Version 2.6.11 
xsl
XSL enabled 
libxslt Version 1.1.7 
libxslt compiled against libxml Version 2.6.11 
EXSLT enabled 
libexslt Version 0.8.5
[2004年12月14日 12:18 UTC] rrichards@php.net
First off, your reproduce scripts dont work under xsltproc - latest libml/libxslt (undefined entities - nbsp). Anways...
A new parameter has been added for PHP 5.1 (in CVS now) for loading documents. You would need to load your xsl sheets and use a CDATA node:
<xsl:text disable-output-escaping='yes'><![CDATA[A&nbsp;&nbsp;&nbsp;a]]></xsl:text> by:
$xsl->load( $xslfile, LIBXML_NOCDATA); as the CDATA must be internally converted to TEXT nodes for the disable-output-escaping to work (xsltproc does this automatically for stylesheets).
For 5.0.x you will need to do a workaround using:
<xsl:text disable-output-escaping='yes'>A&amp;nbsp;&amp;nbsp;&amp;nbsp;a</xsl:text>
PHP Copyright © 2001-2025 The PHP Group
All rights reserved. Last updated: Mon Sep 01 18:00:03 2025 UTC

AltStyle によって変換されたページ (->オリジナル) /