php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25644 xsl:sort with data-type='text' ... php crashes
Submitted: 2003-09-24 09:13 UTC Modified: 2003-10-21 05:23 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: sparky_industries at mad dot scientist dot com Assigned: edink (profile)
Status: Closed Package: XSLT related
PHP Version: 4.3.3 OS: Windows 98
Private report: No CVE-ID: None
 [2003-09-24 09:13 UTC] sparky_industries at mad dot scientist dot com
Description:
------------
if i want to xsl:sort the elements of xsl:for-each and set data-type to 'text' (or drop data-type, which is the same), php crashes (windows error-popup)!

Reproduce code:
---------------
XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
   <names>
      <name>hansi</name>
      <name>bergi</name>
      <name>krabi</name>
      <name>tali</name>
   </names>
</root>

XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
<xsl:template match="/root">
	<xsl:apply-templates select="names" />
</xsl:template>

<xsl:template match="names">
	<xsl:for-each select="name">
		<xsl:sort select="." order="descending" data-type="text" />
		<xsl:value-of select="." />
		<br />
	</xsl:for-each>
</xsl:template>

</xsl:stylesheet>

Expected result:
----------------
tali<br />
krabi<br />
hansi<br />
bergi<br />




Actual result:
--------------
PHP crashes ...

if i exclude the xsl:sort instruction, it works !

it also works, when data-type="number" (this makes no sense here), but if i drop it, or set data-type="text" php crashes

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-24 09:41 UTC] sniper@php.net
Add the php script here too.

 [2003-09-24 16:11 UTC] sparky_industries at mad dot scientist dot com
according to "php script":

i would like to add the php script, but it is totally integrated into a big framework, so it would not make sense to extract a few code-lines.

but it works like that:


$xml = function-to-generate-xml-document();
// xml-document is both WELLFORMED and VALID, i really checked that!

$xsl = implode("", file($xslfile));

$arguments = array
(		
   "/_xml" => $xml,
   "/_xsl" => $xsl
);

$xh = xslt_create();
@xslt_set_base($xh, "file://" . $valid_base);
// the base is set to the directory of the xsl_file
					
$xml = @xslt_process($xh, "arg:/_xml", "arg:/_xsl",  NULL, $arguments);
 [2003-09-24 16:13 UTC] sparky_industries at mad dot scientist dot com
Operating System:

i tried the same script (same configuration of apache2 and php) on windows XP - IT WORKES !!!

so it has to do something with the operating system!
 [2003-09-24 19:48 UTC] sniper@php.net
Works fine in Linux too. Are you sure you just don't have some old xslt related dll in your win98 machine?

 [2003-09-25 03:14 UTC] sparky_industries at mad dot scientist dot com
no, i don't think so, i have downloaded the new version (4.3.3) of php (windows zip package) with all the extensions, so this can not be the problem.

furthermore, i use the same apache2, the same php package and the same explorer on another machine running windows xp ... and it works! everything is completely the same, except the operating system ... (maybe windows 98 is really too old ;)
 [2003-09-25 03:24 UTC] sparky_industries at mad dot scientist dot com
i do not know, if this is helpful or not, but these are the details of the error-popups i get (i always geht three popups, once, i try to sort with data-type="text")


PHP verursachte einen Fehler durch eine ung?ltige Seite
in Modul SABLOT.DLL bei 015f:014c154f.
Register:
EAX=00000000 CS=015f EIP=014c154f EFLGS=00010202
EBX=00000000 SS=0167 ESP=0063b978 EBP=0063bab8
ECX=00000013 DS=0167 ESI=00819740 FS=1b4f
EDX=0063baec ES=0167 EDI=00819740 GS=0000
Bytes bei CS:EIP:
ff 49 40 8b 41 40 c3 8b 41 34 8b 4c 24 04 56 8b 
Stapelwerte:
014c1d87 0063badc 014c8702 00000001 0063badc 00000000 014c9e2f 0080bc60 014ca58f 008199c0 00000004 00819df0 00000000 02070207 320e480e 090e210e 


PHP verursachte einen Fehler durch eine ung?ltige Seite
in Modul SABLOT.DLL bei 015f:014c154f.
Register:
EAX=00000000 CS=015f EIP=014c154f EFLGS=00010202
EBX=00000000 SS=0167 ESP=0063b4bc EBP=0063b4ec
ECX=00000013 DS=0167 ESI=00819740 FS=1b4f
EDX=0063baec ES=0167 EDI=00819740 GS=0000
Bytes bei CS:EIP:
ff 49 40 8b 41 40 c3 8b 41 34 8b 4c 24 04 56 8b 
Stapelwerte:
014c1d87 0063badc 014c8702 014f1d20 0063badc 0063bb68 014c868b 00000002 0063badc 0063b538 014ed08b 00000000 0063bb74 7800b0a7 014f1d20 00000002 


PHP verursachte einen Fehler durch eine ung?ltige Seite
in Modul MSVCRT.DLL bei 015f:7800b936.
Register:
EAX=00650078 CS=015f EIP=7800b936 EFLGS=00010206
EBX=00000020 SS=0167 ESP=0063af7c EBP=0063af98
ECX=000000a0 DS=0167 ESI=0081996c FS=1b4f
EDX=00000000 ES=0167 EDI=00000017 GS=0000
Bytes bei CS:EIP:
89 5a 04 8b 55 0c 89 4d fc 8b 5a 04 8b 52 08 89 
Stapelwerte:
00819e08 00819970 0063be58 00653018 00000020 000000e0 00000080 0063afdc 7800b30c 0075000c 008199ec 00819e08 00819e24 0063be58 0063afdc 0075000c
 [2003-09-25 10:44 UTC] sniper@php.net
What does phpinfo() say about Sablotron version?

 [2003-09-26 13:50 UTC] sparky_industries at mad dot scientist dot com
PHPINFO - XSLT EXTENSION:

XSLT support        enabled  
Backend            Sablotron  
Sablotron Version  0.97
 [2003-09-30 10:19 UTC] sniper@php.net
Edin, update the Sablot lib in the win32 build.

 [2003-10-21 05:23 UTC] edink@php.net
Sablot updated to 1.0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 12:01:28 2024 UTC