kaffa / textpattern

Automatically exported from code.google.com/p/textpattern
0 stars 0 forks source link

URL to download a file doesn't work #420

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install Textpattern from current SVN version at time of writing
2. Upload a file in the admin-side
3. Download the file using the provided link

What is the expected output? What do you see instead?
I expect the download to start. Instead, I am shown a 404. The URL format is:

http://example.com/index.php?s=file_download&id=1

It should be:

http://example.com/index.php?s=file_download&id=1

File is confirmed as existing and can be downloaded manually, outside of 
Textpattern. 4.5.5 uses the latter format and works. Using the latter format 
with the SVN release also works.

What version of the product are you using? On what operating system?
4.6-dev (1306ac2a805ad7eb416aea68276362b5), Ubuntu 14.04LTS.

Please provide any additional information below.
Public test server with example:

Site: http://svn-demo.textpattern.co
User: textpattern1
Pass: textpattern1

I'm still looking for where this happens in source - haven't located it yet.

Original issue reported on code.google.com by p...@pragmatika.net on 17 Jul 2014 at 4:27

GoogleCodeExporter commented 8 years ago
Ah - looks like it's in lib/txplib_misc.php lines 5465 to 5487.

Original comment by p...@pragmatika.net on 17 Jul 2014 at 4:32

GoogleCodeExporter commented 8 years ago
If it's not clear from the opening issue, URL format is set to `?=messy`.

Original comment by p...@pragmatika.net on 17 Jul 2014 at 4:37

GoogleCodeExporter commented 8 years ago
The join_qs() function encodes URL params using 'amp;'. Is this universally 
desirable? We could:

* Build up the file download URL by hand.
* Add some switches to join_qs() that govern the escape-ness of the result, and 
use them in this case.
* Look at the file_download code and see if the URL is being interpreted 
wrongly.

Not sure which way to jump for the best. Anyone else have any thoughts?

I wonder if this affects pagelinkurl too...

Original comment by stefdawson on 11 Sep 2014 at 10:21