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

Sparkline: Fix value sanitizing #14907

Closed
wants to merge 1 commit into from

Conversation

MichaelRoosz
Copy link
Contributor

@MichaelRoosz MichaelRoosz commented Sep 24, 2019

My last pull request (#14901) tried to fix the problem of values with spaces at the end in the Sparkline class (making the values "non-numeric").

While doing some more debugging I also encountered "non-breaking" spaces in some values, which the trim() function (my previous fix) does not remove.

These special spaces are hard to remove, because they sometimes are encoded in ISO/ASCII (hex 0xA0) as well as UTF-8 (hex 0xC2 0xA0). Without making use of the mb_* functions it will be hard to remove all of them while not damaging utf-8 strings.

This PR tries to solve the problem by making use of filter_var() to sanitize the value and remove all non-numeric characters.

See also #14662 (comment)

@MichaelRoosz MichaelRoosz deleted the 3.x-dev branch October 29, 2023 13:53
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.

None yet

1 participant