|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-28 21:18 UTC] sniper@php.net
[2005-03-02 19:32 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
Description: ------------ If we have <xsl:key name="bar" match="foo" use="@baz"/> anywere in stylesheet, any call of php:function('anyFunction',some/node) crush php. In result, Apache return 500 (and Windows say: "Unhandled exception at 0x10189120 in php-cgi.exe: 0xC0000005: Access violation reading location 0x31223d72"), or never return anything, or PHP return many false errors. PHP - release 5.0.2, win32 binary distribution. Configure Command (from PHPinfo): cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared" Server API: CGI/FastCGI Apache - 1.3.27 (Win32) libxml2 - 2.6.11, libxslt - 1.1.7, libexslt - 0.8.5 P.S. We can see "Expected result" after we delete string with mark <!-- !!! --> in "Reproduce code"... Reproduce code: --------------- <?php function myCrach($xml) { return $xml[0]->nodeName; } $txtxsl=<<<XSL <xsl:stylesheet version="1.0" xmlns:php="http://php.net/xsl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:key name="data" match="tag" use="@bar"/> <!-- !!! --> <xsl:template match="tag"> <xsl:value-of select="php:function('myCrach',..)"/> </xsl:template> </xsl:stylesheet> XSL; $domxml=DomDocument::loadXML('<test><tag bar="foo">baz</tag> </test>'); $domxsl=DomDocument::loadXML($txtxsl); $xsl=new xsltProcessor(); $xsl->registerPhpFunctions(); $xsl->importStylesheet($domxsl); echo $xsl->transformtoXML($domxml); ?> Expected result: ---------------- test Actual result: -------------- server no response, php going to infinite cycle...