core icon indicating copy to clipboard operation
core copied to clipboard

Share with 'space' in filename not working

Open Fursje opened this issue 13 years ago • 5 comments

Hello,

If you share a folder with files in them, and then try to open the a file that has a 'space' in it, it will try to find the filename with %20 on disk, and that fails.

Example: So 'something funny.jpg' -> 'something%20funny.jpg'

To fix this i added a urldecode($_GET['path']) and that seems to solve it.

File: apps/files_sharing/public.php Line: 166 $basePath = substr($pathAndUser['path'] , strlen('/'.$fileOwner.'/files')); $path = $basePath; if (isset($_GET['path'])) { $path .= urldecode($_GET['path']); }

Release version: 4.5.5 Couldn't find this bug posted here.

Fursje avatar Dec 30 '12 23:12 Fursje

@MTGap @schiesbn @icewind1991 Can you have a look?

karlitschek avatar Feb 09 '13 12:02 karlitschek

I can't reproduce it. Works here without urldecode() on oc4.5.5 and later.

schiessle avatar Feb 09 '13 13:02 schiessle

I am running into this issue on v4.5.7. Steps to reproduce:

  • Create a directory & share it by public URL
  • Add some files to the newly created dir
  • Navigate to the share URL

Result: files containing whitespaces in their filename yield a 'cloud not found' error, while others can be downloaded just fine.

Could one of you guys have a look into this please? @karlitschek @MTGap @schiesbn @icewind1991

woutervanrooy avatar Feb 25 '13 11:02 woutervanrooy

I tried to reproduce what @woutervanrooy described but it worked just fine with todays master.

dragotin avatar Feb 28 '13 09:02 dragotin

I just tried it at my setup and I figured out what goes wrong. The URL is correctly escaped, replacing a whitespace by %20. For some reason it is then escaped again, replacing the % sign by %25. The URL I end up with then contains %2520 for every whitespace in the filename.

It seems to be related to running a reverse proxy in front of ownCloud, as described here: http://serverfault.com/questions/423556/apache-proxypassreverse-escaping-special-characters. If I manage to solve it later today, I will post the solution here for future reference.

woutervanrooy avatar Feb 28 '13 09:02 woutervanrooy