User tests: Successful: Unsuccessful:
See #6803
The à
character has a UTF8 hex value of 0xA0
The non breaking space has a value of 0xC2 0xA0
The normal trim() php method trims the characters chr()
in the charlist one by one.
Therefore when JFilterInput::getInstance->clean($data['created_by_alias'], 'TRIM')
is used, (here for the created by alias field in article edit->publishing) and the alias entered ends with an à
, that character is deleted by the method.
The solution is to use our custom utf8 method JString::trim() instead of trim.
Test before patch by entering Saccà
in the field and saving.
Test after patch.
Also, after patch, make sure it works fine to trim
multibyte space:
「 」
non-breaking space:
「 」
normal space
「 」
by entering one OR the other spaces above before and after the desired word.
Status | New | ⇒ | Pending |
Rel_Number | ⇒ | 6803 | |
Relation Type | ⇒ | Pull Request for |
@test: The changes in libraries/joomla/filter/input.php work fine for me.
I could not test the changes in libraries/vendor/joomla/filter/src/InputFilter.php.
I think, it is not in use, or am I wrong?
Wouldn't it be better to use Joomla\String\String::trim()
directly here?
Should the PR not better be done against the Joomla! Framework Filter repository or is there a way changes in the libraries of the joomla-cms repository will find there way back into the joomla-framework repository?
Normally, a change such as this one has to be also done in Framework.
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Labels |
Removed:
?
|
Labels |
Added:
?
|
Labels |
Added:
?
|
Category | ⇒ | External Library Libraries |
Labels |
Removed:
?
|
Labels |
Removed:
?
|
Labels |
Added:
?
|
Labels |
Added:
?
|
I'm sorry to say, but this PR isn't RTC. We don't make changes to the libraries in the vendor folder as they would be overwritten again when we run composer next time.
That fix needs to be done in the framework repo and from there it will be pulled down again.
Status | Ready to Commit | ⇒ | Pending |
Will delete the part concerning vendor.
Can we use JString::trim()
in the framework?
Labels |
Removed:
?
|
Labels |
Removed:
?
|
It's called differently since it's namespaced. So JString
will not work. It would be Joomla\String\String
or so. And it would add a dependancy for that class to the input package. But that's something the framework guys will have to decide if they want that added dependancy.
Removed changes from vendor folder. Can you RTC again?
Yep, looks fine now.
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-05-15 09:36:46 |
Closed_By | ⇒ | wilsonge |
Milestone |
Added: |
Labels |
Removed:
?
|
@test: works for me, thanks!