Replaced item with *item when parsing XML string

This commit is contained in:
excelwebzone 2011-11-23 17:40:26 -08:00
parent a7f7be2309
commit a0561e5dde
2 changed files with 8 additions and 4 deletions

View File

@ -159,6 +159,10 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
* after login, the user is now redirected to `default_target_path` if `use_referer` is true and the referrer is the `login_path`.
* added a way to remove a token from a session
### Serializer
* [BC BREAK] replaced the `item` XML tag with `*item`
### Translation
* added support for gettext

View File

@ -188,12 +188,12 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
$value = (string) $subnode;
}
if ($key === 'item') {
if ($key === '*item') {
if (isset($value['@key'])) {
$data[(string) $value['@key']] = $value['#'];
} elseif (isset($data['item'])) {
$tmp = $data['item'];
unset($data['item']);
} elseif (isset($data['*item'])) {
$tmp = $data['*item'];
unset($data['*item']);
$data[] = $tmp;
$data[] = $value;
}