aboutsummaryrefslogtreecommitdiffstats
path: root/mod/filestorage.php
diff options
context:
space:
mode:
authorpafcu <pafcu@iki.fi>2014-12-30 22:40:53 +0200
committerpafcu <pafcu@iki.fi>2014-12-30 22:40:53 +0200
commit0623b472371db80c94b02ab1388436b49a746b46 (patch)
treea715f8c30176a77311addf94b8432cbab6a1865b /mod/filestorage.php
parent3096ae43c35d14e02d9f08238aeb726920df8c2f (diff)
parentf6b16e1d5a3b4faa1a2166e664c402eaa34cef1e (diff)
downloadvolse-hubzilla-0623b472371db80c94b02ab1388436b49a746b46.tar.gz
volse-hubzilla-0623b472371db80c94b02ab1388436b49a746b46.tar.bz2
volse-hubzilla-0623b472371db80c94b02ab1388436b49a746b46.zip
Merge pull request #793 from pafcu/filestorageurlfix
Encode URL offered in filestorage. Fixes #780
Diffstat (limited to 'mod/filestorage.php')
-rw-r--r--mod/filestorage.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/mod/filestorage.php b/mod/filestorage.php
index a76a218af..6b731e440 100644
--- a/mod/filestorage.php
+++ b/mod/filestorage.php
@@ -127,10 +127,14 @@ function filestorage_content(&$a) {
$lockstate = (($f['allow_cid'] || $f['allow_gid'] || $f['deny_cid'] || $f['deny_gid']) ? 'lock' : 'unlock');
+ // Encode path that is used for link so it's a valid URL
+ // Keep slashes as slashes, otherwise mod_rewrite doesn't work correctly
+ $encoded_path = str_replace('%2F', '/', rawurlencode($cloudpath));
+
$o = replace_macros(get_markup_template('attach_edit.tpl'), array(
'$header' => t('Edit file permissions'),
'$file' => $f,
- '$cloudpath' => z_root() . '/' . $cloudpath,
+ '$cloudpath' => z_root() . '/' . $encoded_path,
'$parentpath' => $parentpath,
'$uid' => $channel['channel_id'],
'$channelnick' => $channel['channel_address'],