PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » XML » XML_XUL » Bug #2196

html chars

Details

Submitted2004-08-23 07:54 UTC
Fromme at camdaniel dot com
Assignedschst
StatusWont fix
PackageXML_XUL
PHP Version5.0.0
OSGentoo Linux
Roadmaps(Not assigned)

Comments

[2004-08-23 07:54 UTC] me at camdaniel dot com

Description:
------------
XML_XUL 0.8.1

PHP was compiled fairly standard.

Looks as though it's running the attributes through html_special_chars() or something. I can see why the conversion is needed but for oncommand it gets in the road.

Reproduce code:
---------------
<?php
require_once 'XML/XUL.php';
$doc = &XML_XUL::createDocument();
$doc->addStylesheet('chrome://global/skin/');

$win = &$doc->createElement('Window', array(
'title' => 'site configuration')
);
$doc->addRoot($win);
$win->appendChild( $doc->createElement('Script', array('src' => 'xul.js', 'type' => 'application/x-javascript')) );

$tbar = &$doc->createElement('Toolbox', array(
'width' => '100%')
);
$bar = &$tbar->addToolbar(array('id' => 'toolbar', 'style' => 'border-top: 3px black solid'));
$bar->addButton(array(
'id' => 'siteconfig',
'label' => 'site config',
'oncommand' => 'showConfig(\'siteconfig\');')
);

$doc->send();
?>

Expected result:
----------------
<?xml-stylesheet
href="chrome://global/skin/" type="text/css"
?>
<window title="site configuration" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="xul.js" type="application/x-javascript" />
<toolbox width="100%">
<toolbar id="toolbar" style="border-top: 3px black solid">
<toolbarbutton id="siteconfig" label="site config" oncommand="showConfig('siteconfig');" />
</toolbar>
</toolbox>
</window>

Actual result:
--------------
<?xml-stylesheet
href="chrome://global/skin/" type="text/css"
?>
<window title="site configuration" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="xul.js" type="application/x-javascript" />
<toolbox width="100%">
<toolbar id="toolbar" style="border-top: 3px black solid">
<toolbarbutton id="siteconfig" label="site config" oncommand="showConfig(&apos;siteconfig&apos;);" />
</toolbar>
</toolbox>
</window>

[2004-08-23 07:59 UTC] me at camdaniel dot com

Just noticed, that code is cut-pasted and the real script is much bigger and I didn't $win->appendChild($tbar); in the code here but I have actually done that in the main script where I noticed the bug.