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

Issue 497: Sanitize ID Field. #518

Merged
merged 1 commit into from
Jan 30, 2023
Merged

Issue 497: Sanitize ID Field. #518

merged 1 commit into from
Jan 30, 2023

Conversation

kaladay
Copy link
Contributor

@kaladay kaladay commented Jan 30, 2023

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.

  • 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

  • Manually.
  • 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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

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
```
@coveralls
Copy link

Coverage Status

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

@kaladay kaladay merged commit 6600421 into staging Jan 30, 2023
@kaladay kaladay deleted the 497-sanitize_id_field branch February 15, 2023 14:20
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.

The ID for fields, such as facets and more button, need to be sanitized.
3 participants