You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to fill a textbox with an XML I provide, the pasted text is not my original XML, but the XML with backslashes added before the double-quotes.
I've opened a question in StackOverflow with further info:
Here is the example code (copied over from StackOverflow discussion):
publicfunctionreplaceField($field)
{
$baseText = '<?xml version="1.0" encoding="UTF-8"?><RiskAssessmentReply xmlns="http://test.com" > <!-- ExternalId of the Order --> <OrderId>TO_REPLACE</OrderId> <RiskInfo> <Actions> <SystemAction>SystemAction</SystemAction> <FinalAction>FinalAction</FinalAction> </Actions> <Score SystemScore="0"/> </RiskInfo> <!-- One of Accept, Manual_Accept, Reject, Cancel, or Ignore --> <ResponseCode>Accept</ResponseCode> <StoreId>TESTSTORE</StoreId></RiskAssessmentReply>';
$textWithOrderId = preg_replace('/TO_REPLACE/', $GLOBALS['ORDER_ID'], $baseText);
$this->getSession()->getPage()->fillField($field, $textWithOrderId);
}
Then form gets submitted and back in PHP @samuel-redsauce is getting <?xml version=\"1.0\" encoding=\"UTF-8\"?> (note extra \ before ") instead of <?xml version="1.0" encoding="UTF-8"?>.
It's either US encoding given value in the odd manner (should have used htmlspecialchars not addslashes) or it's DomCrawler messing with it. Either way it needs to be investigated.
In meanwhile @samuel-redsauce have used stripcslashes on that fields value in $_POST and no longer have this issue obviously.
When trying to fill a textbox with an XML I provide, the pasted text is not my original XML, but the XML with backslashes added before the double-quotes.
I've opened a question in StackOverflow with further info:
http://stackoverflow.com/questions/23336764/mink-xml-handling-not-as-expected-adds-backslashes-to-feed
The text was updated successfully, but these errors were encountered: