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

InputFilter fails on cleaning string with HEX entities as string #43377

Merged
merged 5 commits into from May 8, 2024

Conversation

AlterBrains
Copy link
Contributor

Summary of Changes

InputFilter::clean($string, 'string') fails when decoding the entities with HEX numbers

Testing Instructions

Execute the code:

$filter = \Joomla\CMS\Filter\InputFilter::getInstance();
var_dump($filter->clean('ÿ', 'string'));
die;

Actual result BEFORE applying this Pull Request

See error chr(): Argument #1 ($codepoint) must be of type int, string given

Expected result AFTER applying this Pull Request

No errors.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@exlemor
Copy link

exlemor commented Apr 26, 2024

I have tested this item ✅ successfully on fee33cb

Hi AlterBrains, I have tested this successfully.

It yields the answer of: string(2) "ÿ" so if that is expected - perfect.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43377.

@richard67
Copy link
Member

I've restored @exlemor 's test result in the issue tracker so it's properly counted again. The commits which have invalidated the count were just clean branch updates.

It yields the answer of: string(2) "ÿ" so if that is expected - perfect.

@exlemor Yes, that character fits to the Unicode character given as hexadecimal number. See e.g. https://www.w3schools.com/charsets/tryit.asp?deci=255&ent=yuml .

@richard67
Copy link
Member

I have tested this item ✅ successfully on 3d3e148

Works as described. In addition, I've tested that decimal values like 'ÿ' and entity names like 'ÿ' continue to work as before.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43377.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43377.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 5, 2024
@richard67 richard67 added the bug label May 5, 2024
@MacJoom MacJoom self-assigned this May 8, 2024
@MacJoom MacJoom added this to the Joomla! 4.4.5 milestone May 8, 2024
@MacJoom MacJoom merged commit e11bd13 into joomla:4.4-dev May 8, 2024
3 checks passed
@MacJoom
Copy link
Contributor

MacJoom commented May 8, 2024

Thank you!

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants