php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50742 value parameter must be escaped
Submitted: 2010-01-13 18:00 UTC Modified: 2010-01-16 22:09 UTC
From: ifland at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ifland at gmail dot com
New email:
PHP Version: OS:

 

 [2010-01-13 18:00 UTC] ifland at gmail dot com
Description:
------------
The value parameter must be escaped - putting ampersands in the string will cause an exception. See http://bugs.php.net/bug.php?id=31191

Reproduce code:
---------------
---
From manual page: domdocument.createelement#Parameters
---

"The value of the element. By default, an empty element will be created. You can also set the value later with DOMElement->nodeValue."

Expected result:
----------------
There should be a comment about how the $value parameter must be escaped and that the developer probably should use $document->createTextElement() instead. Perhaps something like this:

"The ampersand-escaped value of the element. By default, an empty element will be created. You can also set the value later with DOMElement->nodeValue. To create a text node with escaping support, leave out this parameter, use DOMDocument->createTextElement() and append the text node to your DOMElement."

Actual result:
--------------
"The value of the element. By default, an empty element will be created. You can also set the value later with DOMElement->nodeValue."

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-16 22:09 UTC] svn@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=293629
Log: - Fixed bug#50742 (value parameter must be escaped)
- Kill "you" usage
 [2010-01-16 22:09 UTC] bjori@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2010-01-16 22:13 UTC] svn@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=293630
Log: Rephrase after reading bug#31191 (see bug#50742)
 [2010-03-31 19:36 UTC] sites at hubmed dot org
DOMDocument::createTextElement doesn't exist. Should it be DOMDocument::createTextNode()?

This note could be added to the documentation for DOMDocument::createElementNS as well.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 03:00:02 2026 UTC