Skip to content

Conversation

ziadoz
Copy link
Contributor

@ziadoz ziadoz commented Jan 19, 2016

  • Added new sanitise() method that removes invalid XML characters (e.g. record separator).
  • Invalid characters are replaced with a single space.
  • Updated escape() to sanitise automatically.
  • Ensured raw long-description value gets sanitised.
  • Updated unit tests to include invalid character.

PHP Warning: DOMNode::appendChild(): Document Fragment is empty in php-demandware-xml/src/Document.php on line 95

@ziadoz ziadoz added the bug label Jan 19, 2016
@auxbuss
Copy link

auxbuss commented Jan 19, 2016

👍 So good to see tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the blahblah being sanitised containing one of those invisible characters? If so can you make a comment about, otherwise it just looks weird!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe concatenate one in instead to make it super obvious?

@gabriel403
Copy link
Contributor

Minor comment, otherwise 👍

@ziadoz
Copy link
Contributor Author

ziadoz commented Jan 20, 2016

@maxakropolis @gabriel403 I've put the invalid character into a variable so it's clearer what's going on.

ziadoz added a commit that referenced this pull request Jan 20, 2016
@ziadoz ziadoz merged commit 7c5c10c into master Jan 20, 2016
@ziadoz ziadoz deleted the hotfix/sanitise-xml branch January 20, 2016 10:40
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.

4 participants