Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip illegal xml chars from webservice response #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

francas
Copy link

@francas francas commented Dec 17, 2020

If Web service response contains illegal xml chars, parser fails. This PR adds regex of illegal xml chars to Webservice class and uses it for parsing.

@pedrobaeza
Copy link
Collaborator

Why the webservice will return illegal chars?

@francas
Copy link
Author

francas commented Dec 17, 2020

Why the webservice will return illegal chars?

In our case it was just a matter of having one of the chars '\x0b' in a product description.

@pedrobaeza
Copy link
Collaborator

Yeah, but then ignoring it it's not the best solution, or at least not the best place to do it. It should be Prestashop who strips it before sending, isn't it?

@francas
Copy link
Author

francas commented Dec 17, 2020

Well, it depends. We can control the parsing end (and this makes the parser more resilient) or we can expect PS to fix it. As we needed fix here and now we implemented this in parsing, instead of waiting for PS to fix this on their end.

Just wanted to share this solution in case it was useful.

@pedrobaeza
Copy link
Collaborator

Yeah, thanks for sharing. My only fear is that we don't have the exact same information in one side or the other, so there's the risk of altering information in syncing back without that characters.

@guewen what do you think about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants