?

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
10 Aug 2014

#3182

The problem is that the current download system tries to read the filename from the Content-Disposition expecting that filename is quoted but that's not required. So in some sites (in this example from Github) the update fails.

This is the expected header by the system:
[Content-Disposition] => attachment; filename="plg_sys_mootable-1.1.1.zip"

This is the returned header from some sites:
[Content-Disposition] => attachment; filename=plg_sys_mootable-1.1.1.zip

As you can see the filename comes without the double quotes. I replaced the file name detection to work with both systems because now it's based on the equal sign.

I provided a demo plugin to test the issue.

(see the 3.x tracker here:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33344
to get the demo plugin)

Please attribute this to @phproberto when merging as it's all his code from 3.x

avatar wilsonge wilsonge - open - 10 Aug 2014
avatar jissues-bot jissues-bot - change - 10 Aug 2014
Status Pending New
Labels Added: ? ?
avatar Bakual
Bakual - comment - 10 Aug 2014

Merged into 2.5.-dev.
Also included the fix from #4025.

avatar Bakual Bakual - change - 10 Aug 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-08-10 19:40:50
avatar Bakual Bakual - change - 10 Aug 2014
Title
Backport #3182
[#33344] Backport #3182
avatar Bakual Bakual - close - 10 Aug 2014
avatar wilsonge
wilsonge - comment - 10 Aug 2014

Awesome :) Thanks!

avatar phproberto
phproberto - comment - 12 Aug 2014

Thanks @Bakual & @wilsonge !

Let's rule the world from github from now in advance! hihihihi

avatar jms2win
jms2win - comment - 28 Nov 2014

This new implementation introduced a new bug.
The problem comes when you have a [Content-Disposition] that has additional fields after the filename like
[Content-Disposition] => attachment; filename="plg_sys_mootable-1.1.1.zip";modification-date="xxxx";size="xxx"

In this case, the filename that you get is:
plg_sys_mootable-1.1.1.zip";modification-date="xxxx";size="xxx

that is wrong.

Our proposal is to split the value on ";" and after remove the quotes (")

        $flds = explode( ';', $parts[1]);
        $target = trim( $flds[0], '"');

Add a Comment

Login with GitHub to post a comment