Skip to content

Customer last name is encoded twice in the XML interface #18361

Closed
@nickshatilo

Description

@nickshatilo

Preconditions

  1. Vanilla Magento 2.2.6
  2. PHP Version 7.0.31

Steps to reproduce

  1. Create a customer via Backend with the last name "Foo & Bar Corp"
  2. Create an order (via frontend is fine)
  3. Export the order via XML interfcae
curl -XPOST -H 'Content-Type: application/json' http://hostname/rest/V1/integration/admin/token -d '{ "username": "admin_username", "password": "admin_password" }'
export B=code received above
 curl -X GET --header "Accept: application/xml" --header "Authorization: Bearer $B" "http://hostname/rest/english/V1/orders/1"

Expected result

The customer_lastname tag should contain Foo & Bar Corp

Actual result

The customer_lastname tag contains Foo &amp Bar Corp

Summary

So I think at some point (2014) there was a bug in PHP (SimpleXML) that contained the issue with the ampersand, so that was a fix so that this won't influence any functionality. Currently, on 7.0+ this fix doesn't make sense and creates an error.

Proposed solution

Magento\Framework\Webapi\Rest\Response\Renderer class, _formatValue method. Delete the replacement of the ampersand. This solves the issue.

Metadata

Metadata

Assignees

Labels

Component: WebapiUse with concrete module component label E.g. "Component: Webapi" + "Catalog"Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions