? ? Pending

User tests: Successful: Unsuccessful:

avatar ceford
ceford
8 May 2021

Pull Request for Issue # .

Summary of Changes

Added 'onclick' => 'window.scroll(0,0)' to Administrator Joomla! Help page

Testing Instructions

Go to Administrator / Help / Start Here panel / Joomla! Help
Scroll down to the bottom of the list and click an item there

Actual result BEFORE applying this Pull Request

Nothing appears to happen because the Iframe with the Help page has changed out of site.

Expected result AFTER applying this Pull Request

The page scrolls to the top and the new Help page is seen

Documentation Changes Required

None

avatar ceford ceford - open - 8 May 2021
avatar ceford ceford - change - 8 May 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 May 2021
Category Administration com_admin
avatar Abernyte-Git Abernyte-Git - test_item - 8 May 2021 - Tested successfully
avatar Abernyte-Git
Abernyte-Git - comment - 8 May 2021

I have tested this item successfully on e75acd1


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

avatar richard67 richard67 - change - 8 May 2021
Title
Help scroll top
[4.0] Help scroll top
avatar richard67 richard67 - edited - 8 May 2021
avatar adj9 adj9 - test_item - 8 May 2021 - Tested successfully
avatar adj9
adj9 - comment - 8 May 2021

I have tested this item successfully on e75acd1

__


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

avatar richard67 richard67 - change - 8 May 2021
Status Pending Ready to Commit
Labels Added: ?
avatar richard67
richard67 - comment - 8 May 2021

RTC


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

avatar dgrammatiko
dgrammatiko - comment - 8 May 2021

Inline javascript should be avoided, onclick is a potentially XSS

avatar richard67 richard67 - change - 8 May 2021
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 8 May 2021

Back to pending due to previous comment.


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

avatar ceford
ceford - comment - 8 May 2021

Inline javascript should be avoided, onclick is a potentially XSS

I read that somewhere. But there are 170 instances of onclick in the administrator/components ... what should I do?


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

avatar sandewt
sandewt - comment - 8 May 2021

I read that somewhere. But there are 170 instances of onclick in the administrator/components ... what should I do?

Maybe so: OutputFilter::ampReplace ???

See example:

echo HTMLHelper::_('link', OutputFilter::ampReplace(htmlspecialchars($item->flink, ENT_COMPAT, 'UTF-8', false)), $linktype, $attributes);

OR ???

use Joomla\CMS\Factory;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();

// Add inline JavaScript
$wa->addInlineScript('
    document.addEventListener("DOMContentLoaded", function(event) {
        alert("An inline JavaScript Declaration");
    });
');

See https://docs.joomla.org/J4.x:Http_Header_Management

avatar brianteeman brianteeman - test_item - 8 May 2021 - Tested unsuccessfully
avatar brianteeman
brianteeman - comment - 8 May 2021

I have tested this item ? unsuccessfully on e75acd1

non-sanitised inline scripts are not safe


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

avatar hans2103
hans2103 - comment - 8 May 2021

Inline javascript should be avoided, onclick is a potentially XSS

I read that somewhere. But there are 170 instances of onclick in the administrator/components ... what should I do?

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

replace them all with <button></button> ? Most of them shouldn't be an <a></a>. And start with this one...

avatar ceford
ceford - comment - 8 May 2021

I remembered where I read about not using onclick and the like - it is in CSP documentation. Closing this - I may come with a CSP compliant implementation.

avatar ceford ceford - change - 8 May 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-05-08 21:20:48
Closed_By ceford
Labels Added: ?
avatar ceford ceford - close - 8 May 2021

Add a Comment

Login with GitHub to post a comment