?
Referenced as Pull Request for: # 6806
avatar astrolinux
astrolinux
19 Apr 2015

Steps to reproduce the issue

Put the à (à) character as last character of the field (for example: Saccà)

Expected result

After saving the à character is trimmed because $filter->clean($data['created_by_alias'], 'TRIM') deletes the second byte of the à character in Unicode representation. Saved field returns Sacc instead of Saccà.

Actual result

System information (as much as possible)

Additional comments

avatar astrolinux astrolinux - open - 19 Apr 2015
avatar infograf768
infograf768 - comment - 19 Apr 2015

I confirm, for the letter à indeed as it contains 0xA0.
We use chr(0xC2) . chr(0xA0) in code to trim non-breaking spaces.
But trim() takes these as separate character_mask.

Tested with other unicode glyphs without any issue.
Adding a space and a nbsp after the à before saving solves the issue.

avatar infograf768
infograf768 - comment - 20 Apr 2015

We may have a solution;
Change this line (261):
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/filter/input.php#L261
$result = trim($result, chr(0xC2) . chr(0xA0));
to
$result = JString::trim($result, chr(0xC2) . chr(0xA0));

Can you test?

avatar infograf768
infograf768 - comment - 20 Apr 2015

Patch here:
#6806

avatar fontanil
fontanil - comment - 21 Apr 2015

@test: works for me, thanks!

avatar brianteeman brianteeman - change - 22 Apr 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-04-22 14:43:12
Closed_By brianteeman

Add a Comment

Login with GitHub to post a comment