Bug #36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2013-06-27 Thread hanskrentel at yahoo dot de
Edit report at https://bugs.php.net/bug.php?id=36795edit=1

 ID: 36795
 Comment by: hanskrentel at yahoo dot de
 Reported by:john at carney dot id dot au
 Summary:Inappropriate unterminated entity reference in
 DOMElement-setAttribute
 Status: Not a bug
 Type:   Bug
 Package:DOM XML related
 Operating System:   *
 PHP Version:5.*, 6
 Block user comment: N
 Private report: N

 New Comment:

This is bogus because  as character is needed in the attribute values to start 
an 
entity to express character references. Otherwise it would not be possible to 
set 
the superset of all XML attribute values (AttValue; 
http://www.w3.org/TR/xml/#NT-
AttValue), the expression wouldn't be distinct.

Like you need to write \t in a PHP string to express a tab and therefore \\ 
to 
express the slash. I hope this clarifies this a bit.


Previous Comments:

[2011-10-08 18:33:10] matteosistisette at gmail dot com

I'm still observing this issue (by the way, why is it marked as bogus?).

Even the simplexml property accessors does give me the warning, such as:

$a['b'] =   '; // GENERATES THE WARNING


[2011-09-11 01:40:13] abxccd at msn dot com

I am still seeing this bug in PHP 5.3.8


[2011-02-23 03:30:34] jan-bugreport at gmx dot de

With simpleXML, addChild($name, $value) works really weird (tested on 5.3.1 on 
win): in the value, the characters  and  are correctly esacped to lt; and 
gt; but ampersands cause the unterminated entity reference message. I would 
understand if it escaped nothing, or if it escaped everything, but this seems 
weird.

Also, no matter what the final decision about this bug will be, this should be 
documented really well in the SimpleXML docs. It is confusing and I could 
imagine it could cause security issues in some applications.


[2010-09-22 01:02:27] steven at navolutions dot com

I also had this issue, one thing that might not have been included in the 
original reproducing of the code is that the DOMElement may have been extended. 
I know mine is extended so Reproduce the code by extending the DOMElement 
class. I also extended the DOMDocuement class so try that too. So no the status 
is not Bogus, just to tested thoroughly.


[2010-04-09 14:01:23] rricha...@php.net

Behavior as defined by DOM specs. No warnings are issued are from either of the 
2 
examples in the reproduced code.

addChild() method described in later reports works are defined by specs. Use 
the 
simplexml property accessors for auto escaping.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=36795


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=36795edit=1


Bug #36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2011-10-08 Thread matteosistisette at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=36795edit=1

 ID: 36795
 Comment by: matteosistisette at gmail dot com
 Reported by:john at carney dot id dot au
 Summary:Inappropriate unterminated entity reference in
 DOMElement-setAttribute
 Status: Bogus
 Type:   Bug
 Package:DOM XML related
 Operating System:   *
 PHP Version:5.*, 6
 Block user comment: N
 Private report: N

 New Comment:

I'm still observing this issue (by the way, why is it marked as bogus?).

Even the simplexml property accessors does give me the warning, such as:

$a['b'] =   '; // GENERATES THE WARNING


Previous Comments:

[2011-09-11 01:40:13] abxccd at msn dot com

I am still seeing this bug in PHP 5.3.8


[2011-02-23 03:30:34] jan-bugreport at gmx dot de

With simpleXML, addChild($name, $value) works really weird (tested on 5.3.1 on 
win): in the value, the characters  and  are correctly esacped to lt; and 
gt; but ampersands cause the unterminated entity reference message. I would 
understand if it escaped nothing, or if it escaped everything, but this seems 
weird.

Also, no matter what the final decision about this bug will be, this should be 
documented really well in the SimpleXML docs. It is confusing and I could 
imagine it could cause security issues in some applications.


[2010-09-22 01:02:27] steven at navolutions dot com

I also had this issue, one thing that might not have been included in the 
original reproducing of the code is that the DOMElement may have been extended. 
I know mine is extended so Reproduce the code by extending the DOMElement 
class. I also extended the DOMDocuement class so try that too. So no the status 
is not Bogus, just to tested thoroughly.


[2010-04-09 14:01:23] rricha...@php.net

Behavior as defined by DOM specs. No warnings are issued are from either of the 
2 
examples in the reproduced code.

addChild() method described in later reports works are defined by specs. Use 
the 
simplexml property accessors for auto escaping.


[2010-02-04 18:23:10] jalday at delivery dot com

Still seeing this issue... 

$order_x-addChild('location', '1st  52nd');

gives Warning: SimpleXMLElement::addChild(): unterminated entity reference

If I run it as

$order_x-addChild('location', htmlspecialchars('1st  52nd'));

I have no problems.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=36795


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=36795edit=1


Bug #36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2011-09-10 Thread abxccd at msn dot com
Edit report at https://bugs.php.net/bug.php?id=36795edit=1

 ID: 36795
 Comment by: abxccd at msn dot com
 Reported by:john at carney dot id dot au
 Summary:Inappropriate unterminated entity reference in
 DOMElement-setAttribute
 Status: Bogus
 Type:   Bug
 Package:DOM XML related
 Operating System:   *
 PHP Version:5.*, 6
 Block user comment: N
 Private report: N

 New Comment:

I am still seeing this bug in PHP 5.3.8


Previous Comments:

[2011-02-23 03:30:34] jan-bugreport at gmx dot de

With simpleXML, addChild($name, $value) works really weird (tested on 5.3.1 on 
win): in the value, the characters  and  are correctly esacped to lt; and 
gt; but ampersands cause the unterminated entity reference message. I would 
understand if it escaped nothing, or if it escaped everything, but this seems 
weird.

Also, no matter what the final decision about this bug will be, this should be 
documented really well in the SimpleXML docs. It is confusing and I could 
imagine it could cause security issues in some applications.


[2010-09-22 01:02:27] steven at navolutions dot com

I also had this issue, one thing that might not have been included in the 
original reproducing of the code is that the DOMElement may have been extended. 
I know mine is extended so Reproduce the code by extending the DOMElement 
class. I also extended the DOMDocuement class so try that too. So no the status 
is not Bogus, just to tested thoroughly.


[2010-04-09 14:01:23] rricha...@php.net

Behavior as defined by DOM specs. No warnings are issued are from either of the 
2 
examples in the reproduced code.

addChild() method described in later reports works are defined by specs. Use 
the 
simplexml property accessors for auto escaping.


[2010-02-04 18:23:10] jalday at delivery dot com

Still seeing this issue... 

$order_x-addChild('location', '1st  52nd');

gives Warning: SimpleXMLElement::addChild(): unterminated entity reference

If I run it as

$order_x-addChild('location', htmlspecialchars('1st  52nd'));

I have no problems.


[2009-10-22 16:28:09] gary dot malcolm at gmail dot com

I'm running PHP 5.2.9 on Linux and this bug is still alive and well making 
SimpleXml absolutely inappropriate for XML communications between systems.
code
$safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);
  return $sxml-addChild($name, $safe_value);
/code
Is just plain wrong. I'm communicating user input directly to a bank as I can't 
know how the third party will parse their xml.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=36795


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=36795edit=1


Bug #36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2011-02-22 Thread jan-bugreport at gmx dot de
Edit report at http://bugs.php.net/bug.php?id=36795edit=1

 ID: 36795
 Comment by: jan-bugreport at gmx dot de
 Reported by:john at carney dot id dot au
 Summary:Inappropriate unterminated entity reference in
 DOMElement-setAttribute
 Status: Bogus
 Type:   Bug
 Package:DOM XML related
 Operating System:   *
 PHP Version:5.*, 6
 Block user comment: N
 Private report: N

 New Comment:

With simpleXML, addChild($name, $value) works really weird (tested on
5.3.1 on win): in the value, the characters  and  are correctly
esacped to lt; and gt; but ampersands cause the unterminated entity
reference message. I would understand if it escaped nothing, or if it
escaped everything, but this seems weird.



Also, no matter what the final decision about this bug will be, this
should be documented really well in the SimpleXML docs. It is confusing
and I could imagine it could cause security issues in some applications.


Previous Comments:

[2010-09-22 01:02:27] steven at navolutions dot com

I also had this issue, one thing that might not have been included in
the original reproducing of the code is that the DOMElement may have
been extended. I know mine is extended so Reproduce the code by
extending the DOMElement class. I also extended the DOMDocuement class
so try that too. So no the status is not Bogus, just to tested
thoroughly.


[2010-04-09 14:01:23] rricha...@php.net

Behavior as defined by DOM specs. No warnings are issued are from either
of the 2 

examples in the reproduced code.



addChild() method described in later reports works are defined by specs.
Use the 

simplexml property accessors for auto escaping.


[2010-02-04 18:23:10] jalday at delivery dot com

Still seeing this issue... 



$order_x-addChild('location', '1st  52nd');



gives Warning: SimpleXMLElement::addChild(): unterminated entity
reference



If I run it as



$order_x-addChild('location', htmlspecialchars('1st  52nd'));



I have no problems.


[2009-10-22 16:28:09] gary dot malcolm at gmail dot com

I'm running PHP 5.2.9 on Linux and this bug is still alive and well
making SimpleXml absolutely inappropriate for XML communications between
systems.

code

$safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);

  return $sxml-addChild($name, $safe_value);

/code

Is just plain wrong. I'm communicating user input directly to a bank as
I can't know how the third party will parse their xml.


[2008-04-03 23:15:04] rob at electronicinsight dot com

A little hack to get around this bug:



function safe_add_child($sxml, $name, $value) {

  $safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);

  return $sxml-addChild($name, $safe_value);

}




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=36795


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=36795edit=1


Bug #36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2010-09-21 Thread steven at navolutions dot com
Edit report at http://bugs.php.net/bug.php?id=36795edit=1

 ID: 36795
 Comment by: steven at navolutions dot com
 Reported by:john at carney dot id dot au
 Summary:Inappropriate unterminated entity reference in
 DOMElement-setAttribute
 Status: Bogus
 Type:   Bug
 Package:DOM XML related
 Operating System:   *
 PHP Version:5.*, 6
 Block user comment: N

 New Comment:

I also had this issue, one thing that might not have been included in
the original reproducing of the code is that the DOMElement may have
been extended. I know mine is extended so Reproduce the code by
extending the DOMElement class. I also extended the DOMDocuement class
so try that too. So no the status is not Bogus, just to tested
thoroughly.


Previous Comments:

[2010-04-09 14:01:23] rricha...@php.net

Behavior as defined by DOM specs. No warnings are issued are from either
of the 2 

examples in the reproduced code.



addChild() method described in later reports works are defined by specs.
Use the 

simplexml property accessors for auto escaping.


[2010-02-04 18:23:10] jalday at delivery dot com

Still seeing this issue... 



$order_x-addChild('location', '1st  52nd');



gives Warning: SimpleXMLElement::addChild(): unterminated entity
reference



If I run it as



$order_x-addChild('location', htmlspecialchars('1st  52nd'));



I have no problems.


[2009-10-22 16:28:09] gary dot malcolm at gmail dot com

I'm running PHP 5.2.9 on Linux and this bug is still alive and well
making SimpleXml absolutely inappropriate for XML communications between
systems.

code

$safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);

  return $sxml-addChild($name, $safe_value);

/code

Is just plain wrong. I'm communicating user input directly to a bank as
I can't know how the third party will parse their xml.


[2008-04-03 23:15:04] rob at electronicinsight dot com

A little hack to get around this bug:



function safe_add_child($sxml, $name, $value) {

  $safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);

  return $sxml-addChild($name, $safe_value);

}


[2008-02-08 20:09:37] moshe at varien dot com

PHP 5.2.4

Looks like the problem appears when there's node already exists being
overwritten



// works ok, doesn't require encoding:

$a = simplexml_load_string('a/'); 

$a-b =   ' ;



// doesn't work, requires encoding:

$a = simplexml_load_string('abtest/b/a'); 

$a-b =   ' ; 



// doesn't work, always requires encoding

$a-addChild('b',   ');

$a-addAttribute('b',   ');



// works ok, never requires encoding

$a['b'] =   ';




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=36795


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=36795edit=1


#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2010-02-04 Thread jalday at delivery dot com
 ID:   36795
 Comment by:   jalday at delivery dot com
 Reported By:  john at carney dot id dot au
 Status:   Open
 Bug Type: DOM XML related
 Operating System: *
 PHP Version:  5.*, 6
 New Comment:

Still seeing this issue... 

$order_x-addChild('location', '1st  52nd');

gives Warning: SimpleXMLElement::addChild(): unterminated entity
reference

If I run it as

$order_x-addChild('location', htmlspecialchars('1st  52nd'));

I have no problems.


Previous Comments:


[2009-10-22 16:28:09] gary dot malcolm at gmail dot com

I'm running PHP 5.2.9 on Linux and this bug is still alive and well
making SimpleXml absolutely inappropriate for XML communications between
systems.
code
$safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);
  return $sxml-addChild($name, $safe_value);
/code
Is just plain wrong. I'm communicating user input directly to a bank as
I can't know how the third party will parse their xml.



[2008-04-03 23:15:04] rob at electronicinsight dot com

A little hack to get around this bug:

function safe_add_child($sxml, $name, $value) {
  $safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);
  return $sxml-addChild($name, $safe_value);
}



[2008-02-08 20:09:37] moshe at varien dot com

PHP 5.2.4
Looks like the problem appears when there's node already exists being
overwritten

// works ok, doesn't require encoding:
$a = simplexml_load_string('a/'); 
$a-b =   ' ;

// doesn't work, requires encoding:
$a = simplexml_load_string('abtest/b/a'); 
$a-b =   ' ; 

// doesn't work, always requires encoding
$a-addChild('b',   ');
$a-addAttribute('b',   ');

// works ok, never requires encoding
$a['b'] =   ';



[2007-11-27 14:03:55] oscar at cdcovers dot to

I tried the workaround below and it seems to work:

$xml-addChild('element', '');
$xml-element = str_replace(, amp;, value of the element);



[2006-12-06 11:49:37] philippe dot levan_nospam at kitpages dot fr

Hi,

I have the same problem. My config is :
- PHP 5.2
- libxml Version 2.6.16
-
?php
$xmlStr = ?xml version='1.0' encoding='UTF-8'?root/root;
$xml = new SimpleXMLElement($xmlStr);
$xml-addChild(foo,utf8_encode(start   end));
echo foo tag added ok;
$xml-addChild(bar,utf8_encode(start  end));
echo error on bar tag because of amp;;
$result = $xml-asXML();
echo pre.htmlentities($result)./pre;
?
-
you can run this script at :
http://www.kitpages.fr/test/bugSimpleXml.php



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/36795

-- 
Edit this bug report at http://bugs.php.net/?id=36795edit=1



#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2009-10-22 Thread gary dot malcolm at gmail dot com
 ID:   36795
 Comment by:   gary dot malcolm at gmail dot com
 Reported By:  john at carney dot id dot au
 Status:   No Feedback
 Bug Type: DOM XML related
 Operating System: Windows/Linux
 PHP Version:  5.1.2
 New Comment:

I'm running PHP 5.2.9 on Linux and this bug is still alive and well
making SimpleXml absolutely inappropriate for XML communications between
systems.
code
$safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);
  return $sxml-addChild($name, $safe_value);
/code
Is just plain wrong. I'm communicating user input directly to a bank as
I can't know how the third party will parse their xml.


Previous Comments:


[2008-04-03 23:15:04] rob at electronicinsight dot com

A little hack to get around this bug:

function safe_add_child($sxml, $name, $value) {
  $safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);
  return $sxml-addChild($name, $safe_value);
}



[2008-02-08 20:09:37] moshe at varien dot com

PHP 5.2.4
Looks like the problem appears when there's node already exists being
overwritten

// works ok, doesn't require encoding:
$a = simplexml_load_string('a/'); 
$a-b =   ' ;

// doesn't work, requires encoding:
$a = simplexml_load_string('abtest/b/a'); 
$a-b =   ' ; 

// doesn't work, always requires encoding
$a-addChild('b',   ');
$a-addAttribute('b',   ');

// works ok, never requires encoding
$a['b'] =   ';



[2007-11-27 14:03:55] oscar at cdcovers dot to

I tried the workaround below and it seems to work:

$xml-addChild('element', '');
$xml-element = str_replace(, amp;, value of the element);



[2007-09-28 06:40:20] ocus51 at gail dot com

Hi,

I'm still experiencing this problem :
 - PHP Version  5.2.0-8+etch7
 - DOM/XML API Version  20031129
 - libxml Version   2.6.27



[2006-12-06 11:49:37] philippe dot levan_nospam at kitpages dot fr

Hi,

I have the same problem. My config is :
- PHP 5.2
- libxml Version 2.6.16
-
?php
$xmlStr = ?xml version='1.0' encoding='UTF-8'?root/root;
$xml = new SimpleXMLElement($xmlStr);
$xml-addChild(foo,utf8_encode(start   end));
echo foo tag added ok;
$xml-addChild(bar,utf8_encode(start  end));
echo error on bar tag because of amp;;
$result = $xml-asXML();
echo pre.htmlentities($result)./pre;
?
-
you can run this script at :
http://www.kitpages.fr/test/bugSimpleXml.php



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/36795

-- 
Edit this bug report at http://bugs.php.net/?id=36795edit=1



#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2008-04-03 Thread rob at electronicinsight dot com
 ID:   36795
 Comment by:   rob at electronicinsight dot com
 Reported By:  john at carney dot id dot au
 Status:   No Feedback
 Bug Type: DOM XML related
 Operating System: Windows/Linux
 PHP Version:  5.1.2
 New Comment:

A little hack to get around this bug:

function safe_add_child($sxml, $name, $value) {
  $safe_value = preg_replace('/(?!\w+;)/', 'amp;', $value);
  return $sxml-addChild($name, $safe_value);
}


Previous Comments:


[2008-02-08 20:09:37] moshe at varien dot com

PHP 5.2.4
Looks like the problem appears when there's node already exists being
overwritten

// works ok, doesn't require encoding:
$a = simplexml_load_string('a/'); 
$a-b =   ' ;

// doesn't work, requires encoding:
$a = simplexml_load_string('abtest/b/a'); 
$a-b =   ' ; 

// doesn't work, always requires encoding
$a-addChild('b',   ');
$a-addAttribute('b',   ');

// works ok, never requires encoding
$a['b'] =   ';



[2007-11-27 14:03:55] oscar at cdcovers dot to

I tried the workaround below and it seems to work:

$xml-addChild('element', '');
$xml-element = str_replace(, amp;, value of the element);



[2007-09-28 06:40:20] ocus51 at gail dot com

Hi,

I'm still experiencing this problem :
 - PHP Version  5.2.0-8+etch7
 - DOM/XML API Version  20031129
 - libxml Version   2.6.27



[2006-12-06 11:49:37] philippe dot levan_nospam at kitpages dot fr

Hi,

I have the same problem. My config is :
- PHP 5.2
- libxml Version 2.6.16
-
?php
$xmlStr = ?xml version='1.0' encoding='UTF-8'?root/root;
$xml = new SimpleXMLElement($xmlStr);
$xml-addChild(foo,utf8_encode(start   end));
echo foo tag added ok;
$xml-addChild(bar,utf8_encode(start  end));
echo error on bar tag because of amp;;
$result = $xml-asXML();
echo pre.htmlentities($result)./pre;
?
-
you can run this script at :
http://www.kitpages.fr/test/bugSimpleXml.php



[2006-06-19 14:30:10] php dot net at jax dot be

In PHP 4.2.2 I have the same issue.
code
?php
require_once(sms/messageRelay.class.php);
$doc = domxml_new_doc(1.0);
$msg = $doc-create_element(message);
$msg-set_attribute(type, MT);
$doc-append_child($msg);
$auth = $doc-create_element(authentication);
$str = abc  d  e  f;
$auth-set_content($str);
$msg-append_child($auth);

echo pre;
echo $doc-dump_mem(true, UTF-8); 
echo /pre;
?
/code
It chokes on the .



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/36795

-- 
Edit this bug report at http://bugs.php.net/?id=36795edit=1



#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2008-02-08 Thread moshe at varien dot com
 ID:   36795
 Comment by:   moshe at varien dot com
 Reported By:  john at carney dot id dot au
 Status:   No Feedback
 Bug Type: DOM XML related
 Operating System: Windows/Linux
 PHP Version:  5.1.2
 New Comment:

PHP 5.2.4
Looks like the problem appears when there's node already exists being
overwritten

// works ok, doesn't require encoding:
$a = simplexml_load_string('a/'); 
$a-b =   ' ;

// doesn't work, requires encoding:
$a = simplexml_load_string('abtest/b/a'); 
$a-b =   ' ; 

// doesn't work, always requires encoding
$a-addChild('b',   ');
$a-addAttribute('b',   ');

// works ok, never requires encoding
$a['b'] =   ';


Previous Comments:


[2007-11-27 14:03:55] oscar at cdcovers dot to

I tried the workaround below and it seems to work:

$xml-addChild('element', '');
$xml-element = str_replace(, amp;, value of the element);



[2007-09-28 06:40:20] ocus51 at gail dot com

Hi,

I'm still experiencing this problem :
 - PHP Version  5.2.0-8+etch7
 - DOM/XML API Version  20031129
 - libxml Version   2.6.27



[2006-12-06 11:49:37] philippe dot levan_nospam at kitpages dot fr

Hi,

I have the same problem. My config is :
- PHP 5.2
- libxml Version 2.6.16
-
?php
$xmlStr = ?xml version='1.0' encoding='UTF-8'?root/root;
$xml = new SimpleXMLElement($xmlStr);
$xml-addChild(foo,utf8_encode(start   end));
echo foo tag added ok;
$xml-addChild(bar,utf8_encode(start  end));
echo error on bar tag because of amp;;
$result = $xml-asXML();
echo pre.htmlentities($result)./pre;
?
-
you can run this script at :
http://www.kitpages.fr/test/bugSimpleXml.php



[2006-06-19 14:30:10] php dot net at jax dot be

In PHP 4.2.2 I have the same issue.
code
?php
require_once(sms/messageRelay.class.php);
$doc = domxml_new_doc(1.0);
$msg = $doc-create_element(message);
$msg-set_attribute(type, MT);
$doc-append_child($msg);
$auth = $doc-create_element(authentication);
$str = abc  d  e  f;
$auth-set_content($str);
$msg-append_child($auth);

echo pre;
echo $doc-dump_mem(true, UTF-8); 
echo /pre;
?
/code
It chokes on the .



[2006-04-01 04:49:32] tamit at xmission dot com

This is most definitely a bug.  I've replicated by producing the
following tree in my code:

(This is well-formed XML so I have no idea why there would be a
problem.)

-BEGIN XML
?xml version=1.0 encoding=iso-8859-1?
classes
class classid=0 parentid= class_level=0Rootclass classid=1
parentid=0 class_level=1Adhesives /class
class classid=3286 parentid=0 class_level=1Agricultural 
and
Farming Products/class
class classid=3283 parentid=0 
class_level=1Architectural and
Civil Engineering Products/class
class classid=14 parentid=0 class_level=1Automatic
ID/class
class classid=45 parentid=0 class_level=1Chemical 
Processing
/class
class classid=124 parentid=0 class_level=1Cleaning 
Products
/class
class classid=148 parentid=0 class_level=1Communication
Systems /class
class classid=264 parentid=0 class_level=1Computer 
Hardware
/class
class classid=3281 parentid=0 class_level=1Construction
Equipment and Supplies/class
class classid=489 parentid=0 class_level=1Controls 
/class
class classid=589 parentid=0 class_level=1Display 
/class
class classid=612 parentid=0 class_level=1Electrical
Equipment /class
class classid=772 parentid=0 class_level=1Electronic
Components /class
class classid=3282 parentid=0 class_level=1Explosives, 
Armaments, and Weaponry/class
class classid=920 parentid=0 class_level=1Fasteners 
/class
class classid=954 parentid=0 class_level=1Fluid /class
class classid=3461 parentid=0 class_level=1Food 
Processing
/class
class classid=3288 parentid=0 class_level=1Health, 
Medical,
/class
class classid=1029 parentid=0 class_level=1HVAC/class
class classid=1068 parentid=0 class_level=1Labels Tags
Signage /class
class classid=3279 parentid=0 class_level=1Laboratory 
and
Research Supplies and Equipment/class
class classid=1083 parentid=0
class_level=1Lubricants/class
class classid=1106 parentid=0 class_level=1Machinery
/class
class classid=1424 parentid=0 class_level=1Material 
Handling
/class
class classid=1303 

#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2007-11-27 Thread oscar at cdcovers dot to
 ID:   36795
 Comment by:   oscar at cdcovers dot to
 Reported By:  john at carney dot id dot au
 Status:   No Feedback
 Bug Type: DOM XML related
 Operating System: Windows/Linux
 PHP Version:  5.1.2
 New Comment:

I tried the workaround below and it seems to work:

$xml-addChild('element', '');
$xml-element = str_replace(, amp;, value of the element);


Previous Comments:


[2007-09-28 06:40:20] ocus51 at gail dot com

Hi,

I'm still experiencing this problem :
 - PHP Version  5.2.0-8+etch7
 - DOM/XML API Version  20031129
 - libxml Version   2.6.27



[2006-12-06 11:49:37] philippe dot levan_nospam at kitpages dot fr

Hi,

I have the same problem. My config is :
- PHP 5.2
- libxml Version 2.6.16
-
?php
$xmlStr = ?xml version='1.0' encoding='UTF-8'?root/root;
$xml = new SimpleXMLElement($xmlStr);
$xml-addChild(foo,utf8_encode(start   end));
echo foo tag added ok;
$xml-addChild(bar,utf8_encode(start  end));
echo error on bar tag because of amp;;
$result = $xml-asXML();
echo pre.htmlentities($result)./pre;
?
-
you can run this script at :
http://www.kitpages.fr/test/bugSimpleXml.php



[2006-06-19 14:30:10] php dot net at jax dot be

In PHP 4.2.2 I have the same issue.
code
?php
require_once(sms/messageRelay.class.php);
$doc = domxml_new_doc(1.0);
$msg = $doc-create_element(message);
$msg-set_attribute(type, MT);
$doc-append_child($msg);
$auth = $doc-create_element(authentication);
$str = abc  d  e  f;
$auth-set_content($str);
$msg-append_child($auth);

echo pre;
echo $doc-dump_mem(true, UTF-8); 
echo /pre;
?
/code
It chokes on the .



[2006-04-01 04:49:32] tamit at xmission dot com

This is most definitely a bug.  I've replicated by producing the
following tree in my code:

(This is well-formed XML so I have no idea why there would be a
problem.)

-BEGIN XML
?xml version=1.0 encoding=iso-8859-1?
classes
class classid=0 parentid= class_level=0Rootclass classid=1
parentid=0 class_level=1Adhesives /class
class classid=3286 parentid=0 class_level=1Agricultural 
and
Farming Products/class
class classid=3283 parentid=0 
class_level=1Architectural and
Civil Engineering Products/class
class classid=14 parentid=0 class_level=1Automatic
ID/class
class classid=45 parentid=0 class_level=1Chemical 
Processing
/class
class classid=124 parentid=0 class_level=1Cleaning 
Products
/class
class classid=148 parentid=0 class_level=1Communication
Systems /class
class classid=264 parentid=0 class_level=1Computer 
Hardware
/class
class classid=3281 parentid=0 class_level=1Construction
Equipment and Supplies/class
class classid=489 parentid=0 class_level=1Controls 
/class
class classid=589 parentid=0 class_level=1Display 
/class
class classid=612 parentid=0 class_level=1Electrical
Equipment /class
class classid=772 parentid=0 class_level=1Electronic
Components /class
class classid=3282 parentid=0 class_level=1Explosives, 
Armaments, and Weaponry/class
class classid=920 parentid=0 class_level=1Fasteners 
/class
class classid=954 parentid=0 class_level=1Fluid /class
class classid=3461 parentid=0 class_level=1Food 
Processing
/class
class classid=3288 parentid=0 class_level=1Health, 
Medical,
/class
class classid=1029 parentid=0 class_level=1HVAC/class
class classid=1068 parentid=0 class_level=1Labels Tags
Signage /class
class classid=3279 parentid=0 class_level=1Laboratory 
and
Research Supplies and Equipment/class
class classid=1083 parentid=0
class_level=1Lubricants/class
class classid=1106 parentid=0 class_level=1Machinery
/class
class classid=1424 parentid=0 class_level=1Material 
Handling
/class
class classid=1303 parentid=0 class_level=1Materials
/class
class classid=3284 parentid=0 class_level=1Mechanical
Components and Assemblies/class
class classid=1620 parentid=0 class_level=1Mechanical 
Power
Transmission/class
class classid=3462 parentid=0 class_level=1Mining, Oil
Drilling /class
class classid=1728 parentid=0 class_level=1Mounting 
/class
class classid=3285 parentid=0 
class_level=1Non-Industrial
Products/class
class classid=1782 parentid=0 

#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2007-09-28 Thread ocus51 at gail dot com
 ID:   36795
 Comment by:   ocus51 at gail dot com
 Reported By:  john at carney dot id dot au
 Status:   No Feedback
 Bug Type: DOM XML related
 Operating System: Windows/Linux
 PHP Version:  5.1.2
 New Comment:

Hi,

I'm still experiencing this problem :
 - PHP Version  5.2.0-8+etch7
 - DOM/XML API Version  20031129
 - libxml Version   2.6.27


Previous Comments:


[2006-12-06 11:49:37] philippe dot levan_nospam at kitpages dot fr

Hi,

I have the same problem. My config is :
- PHP 5.2
- libxml Version 2.6.16
-
?php
$xmlStr = ?xml version='1.0' encoding='UTF-8'?root/root;
$xml = new SimpleXMLElement($xmlStr);
$xml-addChild(foo,utf8_encode(start   end));
echo foo tag added ok;
$xml-addChild(bar,utf8_encode(start  end));
echo error on bar tag because of amp;;
$result = $xml-asXML();
echo pre.htmlentities($result)./pre;
?
-
you can run this script at :
http://www.kitpages.fr/test/bugSimpleXml.php



[2006-06-19 14:30:10] php dot net at jax dot be

In PHP 4.2.2 I have the same issue.
code
?php
require_once(sms/messageRelay.class.php);
$doc = domxml_new_doc(1.0);
$msg = $doc-create_element(message);
$msg-set_attribute(type, MT);
$doc-append_child($msg);
$auth = $doc-create_element(authentication);
$str = abc  d  e  f;
$auth-set_content($str);
$msg-append_child($auth);

echo pre;
echo $doc-dump_mem(true, UTF-8); 
echo /pre;
?
/code
It chokes on the .



[2006-04-01 04:49:32] tamit at xmission dot com

This is most definitely a bug.  I've replicated by producing the
following tree in my code:

(This is well-formed XML so I have no idea why there would be a
problem.)

-BEGIN XML
?xml version=1.0 encoding=iso-8859-1?
classes
class classid=0 parentid= class_level=0Rootclass classid=1
parentid=0 class_level=1Adhesives /class
class classid=3286 parentid=0 class_level=1Agricultural 
and
Farming Products/class
class classid=3283 parentid=0 
class_level=1Architectural and
Civil Engineering Products/class
class classid=14 parentid=0 class_level=1Automatic
ID/class
class classid=45 parentid=0 class_level=1Chemical 
Processing
/class
class classid=124 parentid=0 class_level=1Cleaning 
Products
/class
class classid=148 parentid=0 class_level=1Communication
Systems /class
class classid=264 parentid=0 class_level=1Computer 
Hardware
/class
class classid=3281 parentid=0 class_level=1Construction
Equipment and Supplies/class
class classid=489 parentid=0 class_level=1Controls 
/class
class classid=589 parentid=0 class_level=1Display 
/class
class classid=612 parentid=0 class_level=1Electrical
Equipment /class
class classid=772 parentid=0 class_level=1Electronic
Components /class
class classid=3282 parentid=0 class_level=1Explosives, 
Armaments, and Weaponry/class
class classid=920 parentid=0 class_level=1Fasteners 
/class
class classid=954 parentid=0 class_level=1Fluid /class
class classid=3461 parentid=0 class_level=1Food 
Processing
/class
class classid=3288 parentid=0 class_level=1Health, 
Medical,
/class
class classid=1029 parentid=0 class_level=1HVAC/class
class classid=1068 parentid=0 class_level=1Labels Tags
Signage /class
class classid=3279 parentid=0 class_level=1Laboratory 
and
Research Supplies and Equipment/class
class classid=1083 parentid=0
class_level=1Lubricants/class
class classid=1106 parentid=0 class_level=1Machinery
/class
class classid=1424 parentid=0 class_level=1Material 
Handling
/class
class classid=1303 parentid=0 class_level=1Materials
/class
class classid=3284 parentid=0 class_level=1Mechanical
Components and Assemblies/class
class classid=1620 parentid=0 class_level=1Mechanical 
Power
Transmission/class
class classid=3462 parentid=0 class_level=1Mining, Oil
Drilling /class
class classid=1728 parentid=0 class_level=1Mounting 
/class
class classid=3285 parentid=0 
class_level=1Non-Industrial
Products/class
class classid=1782 parentid=0 class_level=1Optics 
/class
class classid=2054 parentid=0 class_level=1Packaging
Equipment /class
class classid=2151 parentid=0 class_level=1Paints 
/class
class classid=2185 parentid=0 class_level=1Plant 
Furnishings

#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2006-12-06 Thread philippe dot levan_nospam at kitpages dot fr
 ID:   36795
 Comment by:   philippe dot levan_nospam at kitpages dot fr
 Reported By:  john at carney dot id dot au
 Status:   No Feedback
 Bug Type: DOM XML related
 Operating System: Windows/Linux
 PHP Version:  5.1.2
 New Comment:

Hi,

I have the same problem. My config is :
- PHP 5.2
- libxml Version 2.6.16
-
?php
$xmlStr = ?xml version='1.0' encoding='UTF-8'?root/root;
$xml = new SimpleXMLElement($xmlStr);
$xml-addChild(foo,utf8_encode(start   end));
echo foo tag added ok;
$xml-addChild(bar,utf8_encode(start  end));
echo error on bar tag because of amp;;
$result = $xml-asXML();
echo pre.htmlentities($result)./pre;
?
-
you can run this script at :
http://www.kitpages.fr/test/bugSimpleXml.php


Previous Comments:


[2006-06-19 14:30:10] php dot net at jax dot be

In PHP 4.2.2 I have the same issue.
code
?php
require_once(sms/messageRelay.class.php);
$doc = domxml_new_doc(1.0);
$msg = $doc-create_element(message);
$msg-set_attribute(type, MT);
$doc-append_child($msg);
$auth = $doc-create_element(authentication);
$str = abc  d  e  f;
$auth-set_content($str);
$msg-append_child($auth);

echo pre;
echo $doc-dump_mem(true, UTF-8); 
echo /pre;
?
/code
It chokes on the .



[2006-04-01 04:49:32] tamit at xmission dot com

This is most definitely a bug.  I've replicated by producing the
following tree in my code:

(This is well-formed XML so I have no idea why there would be a
problem.)

-BEGIN XML
?xml version=1.0 encoding=iso-8859-1?
classes
class classid=0 parentid= class_level=0Rootclass classid=1
parentid=0 class_level=1Adhesives /class
class classid=3286 parentid=0 class_level=1Agricultural 
and
Farming Products/class
class classid=3283 parentid=0 
class_level=1Architectural and
Civil Engineering Products/class
class classid=14 parentid=0 class_level=1Automatic
ID/class
class classid=45 parentid=0 class_level=1Chemical 
Processing
/class
class classid=124 parentid=0 class_level=1Cleaning 
Products
/class
class classid=148 parentid=0 class_level=1Communication
Systems /class
class classid=264 parentid=0 class_level=1Computer 
Hardware
/class
class classid=3281 parentid=0 class_level=1Construction
Equipment and Supplies/class
class classid=489 parentid=0 class_level=1Controls 
/class
class classid=589 parentid=0 class_level=1Display 
/class
class classid=612 parentid=0 class_level=1Electrical
Equipment /class
class classid=772 parentid=0 class_level=1Electronic
Components /class
class classid=3282 parentid=0 class_level=1Explosives, 
Armaments, and Weaponry/class
class classid=920 parentid=0 class_level=1Fasteners 
/class
class classid=954 parentid=0 class_level=1Fluid /class
class classid=3461 parentid=0 class_level=1Food 
Processing
/class
class classid=3288 parentid=0 class_level=1Health, 
Medical,
/class
class classid=1029 parentid=0 class_level=1HVAC/class
class classid=1068 parentid=0 class_level=1Labels Tags
Signage /class
class classid=3279 parentid=0 class_level=1Laboratory 
and
Research Supplies and Equipment/class
class classid=1083 parentid=0
class_level=1Lubricants/class
class classid=1106 parentid=0 class_level=1Machinery
/class
class classid=1424 parentid=0 class_level=1Material 
Handling
/class
class classid=1303 parentid=0 class_level=1Materials
/class
class classid=3284 parentid=0 class_level=1Mechanical
Components and Assemblies/class
class classid=1620 parentid=0 class_level=1Mechanical 
Power
Transmission/class
class classid=3462 parentid=0 class_level=1Mining, Oil
Drilling /class
class classid=1728 parentid=0 class_level=1Mounting 
/class
class classid=3285 parentid=0 
class_level=1Non-Industrial
Products/class
class classid=1782 parentid=0 class_level=1Optics 
/class
class classid=2054 parentid=0 class_level=1Packaging
Equipment /class
class classid=2151 parentid=0 class_level=1Paints 
/class
class classid=2185 parentid=0 class_level=1Plant 
Furnishings
/class
class classid=2196 parentid=0 class_level=1Portable
Tools/class
class classid=2286 parentid=0 class_level=1Printing 
/class
class classid=3539 parentid=0 class_level=1Problematic
Headings/class

#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2006-06-19 Thread php dot net at jax dot be
 ID:   36795
 Comment by:   php dot net at jax dot be
 Reported By:  john at carney dot id dot au
 Status:   No Feedback
 Bug Type: DOM XML related
 Operating System: Windows/Linux
 PHP Version:  5.1.2
 New Comment:

In PHP 4.2.2 I have the same issue.
code
?php
require_once(sms/messageRelay.class.php);
$doc = domxml_new_doc(1.0);
$msg = $doc-create_element(message);
$msg-set_attribute(type, MT);
$doc-append_child($msg);
$auth = $doc-create_element(authentication);
$str = abc  d  e  f;
$auth-set_content($str);
$msg-append_child($auth);

echo pre;
echo $doc-dump_mem(true, UTF-8); 
echo /pre;
?
/code
It chokes on the .


Previous Comments:


[2006-04-01 04:49:32] tamit at xmission dot com

This is most definitely a bug.  I've replicated by producing the
following tree in my code:

(This is well-formed XML so I have no idea why there would be a
problem.)

-BEGIN XML
?xml version=1.0 encoding=iso-8859-1?
classes
class classid=0 parentid= class_level=0Rootclass classid=1
parentid=0 class_level=1Adhesives /class
class classid=3286 parentid=0 class_level=1Agricultural 
and
Farming Products/class
class classid=3283 parentid=0 
class_level=1Architectural and
Civil Engineering Products/class
class classid=14 parentid=0 class_level=1Automatic
ID/class
class classid=45 parentid=0 class_level=1Chemical 
Processing
/class
class classid=124 parentid=0 class_level=1Cleaning 
Products
/class
class classid=148 parentid=0 class_level=1Communication
Systems /class
class classid=264 parentid=0 class_level=1Computer 
Hardware
/class
class classid=3281 parentid=0 class_level=1Construction
Equipment and Supplies/class
class classid=489 parentid=0 class_level=1Controls 
/class
class classid=589 parentid=0 class_level=1Display 
/class
class classid=612 parentid=0 class_level=1Electrical
Equipment /class
class classid=772 parentid=0 class_level=1Electronic
Components /class
class classid=3282 parentid=0 class_level=1Explosives, 
Armaments, and Weaponry/class
class classid=920 parentid=0 class_level=1Fasteners 
/class
class classid=954 parentid=0 class_level=1Fluid /class
class classid=3461 parentid=0 class_level=1Food 
Processing
/class
class classid=3288 parentid=0 class_level=1Health, 
Medical,
/class
class classid=1029 parentid=0 class_level=1HVAC/class
class classid=1068 parentid=0 class_level=1Labels Tags
Signage /class
class classid=3279 parentid=0 class_level=1Laboratory 
and
Research Supplies and Equipment/class
class classid=1083 parentid=0
class_level=1Lubricants/class
class classid=1106 parentid=0 class_level=1Machinery
/class
class classid=1424 parentid=0 class_level=1Material 
Handling
/class
class classid=1303 parentid=0 class_level=1Materials
/class
class classid=3284 parentid=0 class_level=1Mechanical
Components and Assemblies/class
class classid=1620 parentid=0 class_level=1Mechanical 
Power
Transmission/class
class classid=3462 parentid=0 class_level=1Mining, Oil
Drilling /class
class classid=1728 parentid=0 class_level=1Mounting 
/class
class classid=3285 parentid=0 
class_level=1Non-Industrial
Products/class
class classid=1782 parentid=0 class_level=1Optics 
/class
class classid=2054 parentid=0 class_level=1Packaging
Equipment /class
class classid=2151 parentid=0 class_level=1Paints 
/class
class classid=2185 parentid=0 class_level=1Plant 
Furnishings
/class
class classid=2196 parentid=0 class_level=1Portable
Tools/class
class classid=2286 parentid=0 class_level=1Printing 
/class
class classid=3539 parentid=0 class_level=1Problematic
Headings/class
class classid=3463 parentid=0 class_level=1Retail and 
Sales
Equipment/class
class classid=2328 parentid=0 
class_level=1Robotics/class
class classid=2369 parentid=0 class_level=1Safety 
/class
class classid=2399 parentid=0 class_level=1Sensors 
Monitors
/class
class classid=3280 parentid=0 
class_level=1Services/class
class classid=2585 parentid=0 
class_level=1Software/class
class classid=2697 parentid=0 class_level=1Test /class
class classid=3919 parentid=0 class_level=1Textile 
Industry
Products/class
  

#36795 [Com]: Inappropriate unterminated entity reference in DOMElement-setAttribute

2006-03-31 Thread tamit at xmission dot com
 ID:   36795
 Comment by:   tamit at xmission dot com
 Reported By:  john at carney dot id dot au
 Status:   No Feedback
 Bug Type: DOM XML related
 Operating System: Windows/Linux
 PHP Version:  5.1.2
 New Comment:

This is most definitely a bug.  I've replicated by producing the
following tree in my code:

(This is well-formed XML so I have no idea why there would be a
problem.)

-BEGIN XML
?xml version=1.0 encoding=iso-8859-1?
classes
class classid=0 parentid= class_level=0Rootclass classid=1
parentid=0 class_level=1Adhesives /class
class classid=3286 parentid=0 class_level=1Agricultural 
and
Farming Products/class
class classid=3283 parentid=0 
class_level=1Architectural and
Civil Engineering Products/class
class classid=14 parentid=0 class_level=1Automatic
ID/class
class classid=45 parentid=0 class_level=1Chemical 
Processing
/class
class classid=124 parentid=0 class_level=1Cleaning 
Products
/class
class classid=148 parentid=0 class_level=1Communication
Systems /class
class classid=264 parentid=0 class_level=1Computer 
Hardware
/class
class classid=3281 parentid=0 class_level=1Construction
Equipment and Supplies/class
class classid=489 parentid=0 class_level=1Controls 
/class
class classid=589 parentid=0 class_level=1Display 
/class
class classid=612 parentid=0 class_level=1Electrical
Equipment /class
class classid=772 parentid=0 class_level=1Electronic
Components /class
class classid=3282 parentid=0 class_level=1Explosives, 
Armaments, and Weaponry/class
class classid=920 parentid=0 class_level=1Fasteners 
/class
class classid=954 parentid=0 class_level=1Fluid /class
class classid=3461 parentid=0 class_level=1Food 
Processing
/class
class classid=3288 parentid=0 class_level=1Health, 
Medical,
/class
class classid=1029 parentid=0 class_level=1HVAC/class
class classid=1068 parentid=0 class_level=1Labels Tags
Signage /class
class classid=3279 parentid=0 class_level=1Laboratory 
and
Research Supplies and Equipment/class
class classid=1083 parentid=0
class_level=1Lubricants/class
class classid=1106 parentid=0 class_level=1Machinery
/class
class classid=1424 parentid=0 class_level=1Material 
Handling
/class
class classid=1303 parentid=0 class_level=1Materials
/class
class classid=3284 parentid=0 class_level=1Mechanical
Components and Assemblies/class
class classid=1620 parentid=0 class_level=1Mechanical 
Power
Transmission/class
class classid=3462 parentid=0 class_level=1Mining, Oil
Drilling /class
class classid=1728 parentid=0 class_level=1Mounting 
/class
class classid=3285 parentid=0 
class_level=1Non-Industrial
Products/class
class classid=1782 parentid=0 class_level=1Optics 
/class
class classid=2054 parentid=0 class_level=1Packaging
Equipment /class
class classid=2151 parentid=0 class_level=1Paints 
/class
class classid=2185 parentid=0 class_level=1Plant 
Furnishings
/class
class classid=2196 parentid=0 class_level=1Portable
Tools/class
class classid=2286 parentid=0 class_level=1Printing 
/class
class classid=3539 parentid=0 class_level=1Problematic
Headings/class
class classid=3463 parentid=0 class_level=1Retail and 
Sales
Equipment/class
class classid=2328 parentid=0 
class_level=1Robotics/class
class classid=2369 parentid=0 class_level=1Safety 
/class
class classid=2399 parentid=0 class_level=1Sensors 
Monitors
/class
class classid=3280 parentid=0 
class_level=1Services/class
class classid=2585 parentid=0 
class_level=1Software/class
class classid=2697 parentid=0 class_level=1Test /class
class classid=3919 parentid=0 class_level=1Textile 
Industry
Products/class
class classid=3167 parentid=0 class_level=1Thermal 
/class
class classid=3190 parentid=0 class_level=1Timers 
/class
class classid=3287 parentid=0 
class_level=1Transportation
Industry Products/class
class classid=3193 parentid=0 class_level=1Vision
Systems/class
class classid=3208 parentid=0 class_level=1Waste 
Handling
Equipment/class
class classid=3246 parentid=0 class_level=1Welding 
Equipment
/class
/class
/classes
--END XML---


Previous Comments: