joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

InputFilter fails on cleaning string with HEX entities as string

Open AlterBrains opened this issue 1 year ago • 4 comments
trafficstars

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:

  • [x] No documentation changes for docs.joomla.org needed

  • [ ] Pull Request link for manual.joomla.org:

  • [x] No documentation changes for manual.joomla.org needed

AlterBrains avatar Apr 26 '24 15:04 AlterBrains

I have tested this item :white_check_mark: successfully on fee33cb85ecb880ccc873e5fc2ecbfa833a6570f

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.

exlemor avatar Apr 26 '24 21:04 exlemor

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 avatar May 05 '24 14:05 richard67

I have tested this item :white_check_mark: successfully on 3d3e148d71f455eb534b2f0e51cafcd9197677b3

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 avatar May 05 '24 15:05 richard67

RTC


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

richard67 avatar May 05 '24 15:05 richard67

Thank you!

MacJoom avatar May 08 '24 16:05 MacJoom