?
avatar jsubri
jsubri
3 Mar 2018

Steps to reproduce the issue

  • Create a new article with Title "L'association A & L'association B"
  • Edit another article , use image to insert the link of the newly created article.

Expected result

"L'association A & L'association B"

Actual result

"L\'association A & L\'association B"

System information (as much as possible)

3.8.5 using either MCE or CodeMirror.
PHP 5.x, windows and Linux.

Additional comments

https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/views/articles/tmpl/modal.php#L133

avatar jsubri jsubri - open - 3 Mar 2018
avatar joomla-cms-bot joomla-cms-bot - change - 3 Mar 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 3 Mar 2018
avatar jsubri jsubri - change - 4 Mar 2018
The description was changed
avatar jsubri jsubri - edited - 4 Mar 2018
avatar jsubri jsubri - change - 4 Mar 2018
The description was changed
avatar jsubri jsubri - edited - 4 Mar 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2018
Category com_content
avatar infograf768
infograf768 - comment - 4 Mar 2018

Confirmed. Trying to understand why we add slashes there

avatar infograf768
infograf768 - comment - 4 Mar 2018

They are not necessary here as they are not part of a js onclick.
Will make patch.

avatar ggppdk
ggppdk - comment - 4 Mar 2018

It is as you said:

They are not necessary here as they are not part of a js onclick.

Old code need it double esacaping because it was passing the data via parameter of JS method, whose code was inside an onclick Tag parameter

a4b880b#diff-f0f22e7238611f9f5d7ea24bb92099d6L113

but then data were
moved to
'data-*' HTML Tag attributes, and the values were copied without considering that the double escaping was no longer needed

avatar ggppdk
ggppdk - comment - 4 Mar 2018

For menus it is without double escaping
data-title="<?php echo $this->escape($item->title); ?>"

https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_menus/views/items/tmpl/modal.php#L117

So the above is already proper


But there is 1 more modal layout that needs fixing , the contacts selection modal template
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_contact/views/contacts/tmpl/modal.php#L123

since it double escaping too
data-title="<?php echo $this->escape(addslashes($item->name)); ?>"

avatar infograf768
infograf768 - comment - 4 Mar 2018

will include both in PR

avatar infograf768
infograf768 - comment - 4 Mar 2018

Please test #19826

avatar infograf768 infograf768 - change - 4 Mar 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-03-04 08:00:46
Closed_By infograf768
avatar infograf768 infograf768 - close - 4 Mar 2018

Add a Comment

Login with GitHub to post a comment