New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "accept" attribute to the upload file input element of com_joomlaupdate's Upload & Update tab #29877
Add "accept" attribute to the upload file input element of com_joomlaupdate's Upload & Update tab #29877
Conversation
You have to include the other 2 options found here: |
@Quy No. These don't work with Upload & Update. |
@Quy Just try it with current staging or 4.0-dev. In both cases update with a tar.gz or a tar.bz2 fails when using "Upload & Update". |
@Quy On J3: |
Thanks. Why offer those other formats? |
This is a question someone else has to answer, but it is a good question ;-) |
I have tested this item This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29877. |
I have tested this item This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29877. |
Merging here thanks @richard67 and @Quy and @degobbis for testing. |
…m_joomlaupdate (joomla#29877)" This reverts commit 1af13f2.
…m_joomlaupdate (joomla#29877)" This reverts commit 1af13f2.
…nt of com_joomlaupdate (joomla#29877)"" This reverts commit d595995.
Pull Request for Issue #29763 (partly).
Summary of Changes
This Pull Request (PR) adds the "accept" attribute to the file field of the Joomla Update Component's Upload & Update tab so that only zip files with mime type "application/zip" are selectable.
Only zip because currently the Joomla Update Component only supports that packing format for Upload & Update, see also the discussion in comments below. No idea what the other update packages (tar.gz, tar.bz2) are good for. There is no update from folder option or update channel for which they could be used.
Important: This is NOT a security fix, it only shall make it harder to accidently select the wrong file for upload.
See the following description on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept:
I will work on these server-side validations and provide a separate PR.
Browser support see https://caniuse.com/#feat=input-file-accept.
Testing Instructions
On a clean current staging or recent 3.9 nightly build or a 3.9.19, login to backend and go to "Components -> Joomla Update".
Go to the "Upload & Update" tab and use the button right beside "Joomla package file" to select a file for upload.
Result: See section "Actual result BEFORE applying this Pull Request" below.
Apply the patch of this PR.
Repeat step 2.
Result: See section "Expected result AFTER applying this Pull Request" below.
Actual result BEFORE applying this Pull Request
A browser dialogue opens which allows you to select a file. It shows all kinds of files in the currently active folder. There is no filter for zip files only.
E.g. on Firefox 77.0.1 (64-Bit) for Windows:

Expected result AFTER applying this Pull Request
A browser dialogue opens which allows you to select a file. Depending on your browser it limits the files being shown to zip files.
E.g. on Firefox 77.0.1 (64-Bit) for Windows:

Documentation Changes Required
None, I think.