TAMULib / SAGE

Search Aggregation Engine
MIT License
6 stars 1 forks source link

Issue 497: Sanitize ID Field. #518

Closed kaladay closed 1 year ago

kaladay commented 1 year ago

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:

  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 i‍j" | byte_dump -wUt 4

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 the more... link. The link should now open up a modal. This can be tested with just the parenthesis as well.

Checklist:

coveralls commented 1 year ago

Coverage Status

Coverage: 45.777% (+0.5%) from 45.295% when pulling 39f17cd25648420c52ceac2eb05f04da165c077a on 497-sanitize_id_field into 75d2ec437c7e4b7fb8baafae7f006ed065155ecf on staging.