From 6173153e07001b6ed7160f0dfbc54700c5879de8 Mon Sep 17 00:00:00 2001 From: bumperbox Date: Mon, 2 Apr 2012 21:50:13 +1200 Subject: [PATCH] When sending international characters this messages pops up "Xml for post data was invalid, Reference to undeclared entity 'Atilde'", and according to this Stackoverflow http://stackoverflow.com/questions/552957/, addChild does not escape, whereas setting directly via $xml->$key does escape entities, removes the need to try and escape them ourselves first --- xero.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xero.php b/xero.php index 3afa43d..888b3e7 100644 --- a/xero.php +++ b/xero.php @@ -1267,8 +1267,7 @@ public static function toXML( $data, $rootNodeName = 'ResultSet', &$xml=null ) { } else { // add single node. - $value = htmlentities( $value ); - $xml->addChild( $key, $value ); + $xml->$key = $value; } }