?
Related to # 4353
avatar JamesShaver
JamesShaver
25 Sep 2014

Steps to reproduce the issue

Create a user custom profile with a country list and a properly escaped ampersand (Issue tracker may replace my escaped ampersand as non-escaped):
name="country"
type="list"
default=""
label="PLG_USER_PROFILE_FIELD_COUNTRY_LABEL"
description="PLG_USER_PROFILE_FIELD_COUNTRY_DESC">
United States
Antigua & Barbuda
...
Bosnia & Herzegovina
...
Trinidad & Tobago

Expected result

Simple list of countries in the profile

Actual result

Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]: unterminated entity reference Barbuda in /home/website/public_html/joomla/libraries/joomla/form/form.php on line 2119
Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]: unterminated entity reference Herzegovina in /home/website/public_html/joomla/libraries/joomla/form/form.php on line 2119
Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]: unterminated entity reference Tobago in /home/website/public_html/joomla/libraries/joomla/form/form.php on line 2119

System information (as much as possible)

PHP Version: 5.4.24
Web Server: Apache Phusion_Passenger/4.0.10 mod_bwlimited/1.4 mod_fcgid/2.3.9
WebServer to PHP Interface: cgi-fcgi
Joomla! Version: Joomla! 3.3.4 Stable [ Ember ] 23-September-2014 14:00 GMT
Joomla! Platform Version: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0

Additional comments

Solving the problem is simply updating form.php at line 2119:

//$node = $source->addChild($new->getName(), trim($new));
$node = $source->addChild($new->getName(), htmlspecialchars(trim($new)));

Using language files for all of the countries with ampersands also works to solve the issue, however I do not believe this should be the preferred method to fix it.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar quasiman quasiman - open - 25 Sep 2014
avatar Kubik-Rubik
Kubik-Rubik - comment - 25 Sep 2014

Thank you for reporting this issue. Please provide the fix that you have proposed in the description in a PR!

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar zero-24
zero-24 - comment - 26 Sep 2014

Closing as we have a pull request on #4353

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar zero-24 zero-24 - close - 26 Sep 2014
avatar zero-24 zero-24 - change - 26 Sep 2014
Category Libraries
avatar zero-24 zero-24 - change - 26 Sep 2014
Status New Closed
Rel_Number 4353
Relation Type Related to
avatar jissues-bot
jissues-bot - comment - 26 Sep 2014

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org

avatar jissues-bot jissues-bot - close - 26 Sep 2014
avatar jissues-bot jissues-bot - change - 26 Sep 2014
Closed_Date 0000-00-00 00:00:00 2014-09-26 06:23:05
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment