Provide a simple character sanitizer that strips out all ascii and non-ascii characters that are not in the specified range or list of simple characters.
The added unit test includes one or more Unicode whitespace that may or may not be visibly printed. I generated these using my utf8 program, like this:
echo "h$(utf8 -cB U+200A)i$(utf8 -cB U+200D)j"
The code points can be verified using a program like my byte_dump program:
echo -en "a b c\fd e f g h ij" | byte_dump -wUt 4
Fixes #497
Type of change
Please delete options that are not relevant.
[x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
[x] Manually.
[x] Unit test added.
To manually test this in the UI, perform all of the appropriate steps to create a working discovery view. Then for that discovery view, in the management under the Facets tab add a facet of type link with a label such as (Subject) 𔙃 𔙃 𔙃. Then view the discovery view and select the more... link. The link should now open up a modal.
This can be tested with just the parenthesis as well.
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
Coverage: 45.777% (+0.5%) from 45.295% when pulling 39f17cd25648420c52ceac2eb05f04da165c077a on 497-sanitize_id_field into 75d2ec437c7e4b7fb8baafae7f006ed065155ecf on staging.
Description
Provide a simple character sanitizer that strips out all ascii and non-ascii characters that are not in the specified range or list of simple characters.
The added unit test includes one or more Unicode whitespace that may or may not be visibly printed. I generated these using my utf8 program, like this:
The code points can be verified using a program like my byte_dump program:
Fixes #497
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
To manually test this in the UI, perform all of the appropriate steps to create a working discovery view. Then for that discovery view, in the management under the Facets tab add a facet of type
link
with a label such as(Subject) 𔙃 𔙃 𔙃
. Then view the discovery view and select themore...
link. The link should now open up a modal. This can be tested with just the parenthesis as well.Checklist: