Sanitize XML: UTF8 and Control Characters#286
Closed
arielallon wants to merge 15 commits into
Closed
Conversation
Contributor
arielallon
commented
Jan 12, 2021
- utf8_encode() responses without explicit encoding
- strip ascii control characters that may incorrectly make their way into a RETS response (we were seeing this in some random Bright media records)
…t-explicit-encoding utf8_encode() responses without explicit encoding
…pace Change project metadata to NHDS namespace
…haracters HOTFIX | strip ascii control characters
…ecimal - Previous implementation was incorrectly matching a the subset of hexadecimal values between 0x0 and 0x31 (inclusive) that only contained decimal integers in their 0x representation. Since RETS XML responses typically don't xml-encode character references for printable characters, this likely did not affect things it shouldn't have. - Given that this was not matching any control characters' encoded value contained an A-F character in their 0x representation, there were still control characters that weren't being stripped and causing SimpleXMLElement parser errors. - This commit also adds the ability to match control characters as decimal (instead of hexadecimal) if they are so encoded in the XML.
…haracters HOTFIX | Modify control character stripping to match decimal or hexadecimal
- Previous version didn't include 0xA through 0xE. - Added some extra parens on the hex side of the regex to clarify groupings around the | (not strictly necessary) - Updated regexr link
- Mucha's brevity is the soul of wit
…haracters HOTFIX | Add missing range of hex-encoded ASCII control characters
MLSS-1961 | Merging Upstream Changes
Merge Upstream 2.6.2 into master
Contributor
Author
|
Ah, nevermind, I realized already opened (most of) this as #281 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.