? ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
29 May 2018

Summary of Changes

Apply additional escaping to com_media folder paths in template over ride.

Additional Information

As discussed by @joomla/security
With thanks to Herman Peeren

avatar PhilETaylor PhilETaylor - open - 29 May 2018
avatar PhilETaylor PhilETaylor - change - 29 May 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2018
Category Front End Templates (site)
avatar PhilETaylor PhilETaylor - change - 29 May 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2018
Category Front End Templates (site) Administration Templates (admin) Front End Templates (site)
avatar Quy
Quy - comment - 30 May 2018

Going by similar code:

<a class="delete-item" target="_top" href="index.php?option=com_media&amp;task=file.delete&amp;tmpl=index&amp;<?php echo JSession::getFormToken(); ?>=1&amp;folder=<?php echo rawurlencode($this->state->folder); ?>&amp;rm[]=<?php echo $this->escape($this->_tmp_doc->name); ?>" rel="<?php echo $this->escape($this->_tmp_doc->name); ?>"><span class="icon-remove hasTooltip" title="<?php echo JHtml::_('tooltipText', 'JACTION_DELETE');?>"></span></a>
<input type="checkbox" name="rm[]" value="<?php echo $this->escape($this->_tmp_doc->name); ?>" />

<a class="delete-item" target="_top" href="index.php?option=com_media&amp;task=file.delete&amp;tmpl=index&amp;<?php echo JSession::getFormToken(); ?>=1&amp;folder=<?php echo rawurlencode($this->state->folder); ?>&amp;rm[]=<?php echo $this->escape($this->_tmp_img->name); ?>" rel="<?php echo $this->escape($this->_tmp_img->name); ?>"><span class="icon-remove hasTooltip" title="<?php echo JHtml::_('tooltipText', 'JACTION_DELETE');?>"></span></a>
<input type="checkbox" name="rm[]" value="<?php echo $this->escape($this->_tmp_img->name); ?>" />

<a class="delete-item" target="_top" href="index.php?option=com_media&amp;task=file.delete&amp;tmpl=index&amp;<?php echo JSession::getFormToken(); ?>=1&amp;folder=<?php echo rawurlencode($this->state->folder); ?>&amp;rm[]=<?php echo $this->escape($this->_tmp_video->name); ?>" rel="<?php echo $this->escape($this->_tmp_video->name); ?>"><span class="icon-remove hasTooltip" title="<?php echo JHtml::_('tooltipText', 'JACTION_DELETE');?>"></span></a>
<input type="checkbox" name="rm[]" value="<?php echo $this->escape($this->_tmp_video->name); ?>" />

Also in the URL: &amp;rm[]=<?php echo $this->escape($this->_tmp_video->name); ?> and rel="<?php echo $this->escape($this->_tmp_video->name); ?>">

avatar PhilETaylor
PhilETaylor - comment - 30 May 2018

In fact that is never used, none of these files are ever used.

These are the only ones ever used.

	echo $this->loadTemplate('up'),
					$this->loadTemplate('folders'),
					$this->loadTemplate('docs'),
					$this->loadTemplate('videos'),
					$this->loadTemplate('imgs');

The doc video and folder files contain very old code and generate PHP issues when included too - best those get deleted. Will fork a PR for that. - Done - see #20630

avatar Quy
Quy - comment - 30 May 2018

I have tested this item successfully on 4a611a4

Create a media custom field.
Edit an article on the backend/frontend.
Under the Fields tab, click on the Select button of the media field.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20616.
avatar Quy Quy - test_item - 30 May 2018 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Jun 2018

@Quy test with and -out PR i can select an Image for an Article - test on backend.

Please have a look at http://wohlkoenig.joomla.com/index.php

Now i'm on Github and see its about docs and Video, will have a look.

System information

  • 3.8.9-dev
  • Template: Protostar
  • macOS Sierra, 10.13.5
  • Firefox 60 (64-bit)

CloudAccess.net

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 13 Jun 2018 - Tested unsuccessfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Jun 2018

I have tested this item ? unsuccessfully on 4a611a4

After changing allowed Types (mp4, video/mp4) in Media > Option Video-Upload was successfully:
bildschirmfoto 2018-06-13 um 15 11 25

Select Video in Article-Field doesn't work as Video isn't shown:
bildschirmfoto 2018-06-13 um 15 10 35


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20616.
avatar PhilETaylor
PhilETaylor - comment - 13 Jun 2018

@franz-wohlkoenig and so what EXACTLY was the result of your test? just saying I have tested this item unsuccessfully is not enough

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Jun 2018

Thats why i wrote before "Description follows".

Cause i had to mark test in Tracker, switch to Github, create Screenshots and write in English which is not my native language.

This takes its Time, please be patient with an elderly Man.

avatar Quy
Quy - comment - 13 Jun 2018

You will not see a difference in functionality, but only the markup.

Let's create a folder a&b inside the images folder either via FTP or directly if testing locally.
Edit an article.
Click the Image button in the editor.
View the page source of the modal.
Without PR, the folder name is a&b
With PR, folder name is a&amp;b

With the other change, apply escaping to the URL of the folder name on the front end to be consistent with the back end.

avatar PhilETaylor
PhilETaylor - comment - 13 Jun 2018

@franz-wohlkoenig You are testing something that this PR is not actually changing.

What you are seeing is EXPECTED.

You are clicking on the IMAGE button in the WYSIWYG Editor on the frontend, this loads a url in an iframe of: http://127.0.0.1:1025/index.php?option=com_media&view=imagesList&tmpl=component&folder=&asset=61&author=838

This runs this code

and as you can see mp4 extension files are added to a VIDEOS array and not an IMAGES array as used on
$list = array('folders' => $folders, 'docs' => $docs, 'images' => $images, 'videos' => $videos);
and therefore what you are seeing is THE CORRECT AND EXPECTED RESULT and nothing to do with this proposed PR.

avatar joomla-cms-bot joomla-cms-bot - change - 13 Jun 2018
Category Front End Templates (site) Administration Templates (admin) Administration com_media Templates (admin) Front End Templates (site)
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Jun 2018

@PhilETaylor Thanks for Explanation, what this Pull Request is about to test. Can you please adopt this in first Comment so Tester gets easier to understand?

avatar carlitorweb
carlitorweb - comment - 16 Jun 2018

I test the bug of the preview of the image and is fixed.

Now, with this PR:

Click the Image button in the editor. View the page source of the modal. Without PR, the folder name is a&b . With PR, folder name is a&amp;b

Without the PR:

screenshot_20180615202355

With the PR:

screenshot_20180615202526

This is not the expected result, right?

avatar Quy
Quy - comment - 16 Jun 2018

You have to view the page source of the modal and not with web developer inspector.

avatar carlitorweb carlitorweb - test_item - 16 Jun 2018 - Tested successfully
avatar carlitorweb
carlitorweb - comment - 16 Jun 2018

I have tested this item successfully on 9fd42ef

Thank @Quy


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

avatar Quy Quy - test_item - 16 Jun 2018 - Tested successfully
avatar Quy
Quy - comment - 16 Jun 2018

I have tested this item successfully on 9fd42ef


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

avatar Quy Quy - change - 16 Jun 2018
Status Pending Ready to Commit
avatar Quy
Quy - comment - 16 Jun 2018

RTC


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

avatar mbabker mbabker - change - 18 Jun 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-06-18 02:54:31
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 18 Jun 2018
avatar mbabker mbabker - merge - 18 Jun 2018

Add a Comment

Login with GitHub to post a comment