Merge pull request #793 from pafcu/filestorageurlfix
Encode URL offered in filestorage. Fixes #780
This commit is contained in:
commit
0623b47237
@ -127,10 +127,14 @@ function filestorage_content(&$a) {
|
|||||||
|
|
||||||
$lockstate = (($f['allow_cid'] || $f['allow_gid'] || $f['deny_cid'] || $f['deny_gid']) ? 'lock' : 'unlock');
|
$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(
|
$o = replace_macros(get_markup_template('attach_edit.tpl'), array(
|
||||||
'$header' => t('Edit file permissions'),
|
'$header' => t('Edit file permissions'),
|
||||||
'$file' => $f,
|
'$file' => $f,
|
||||||
'$cloudpath' => z_root() . '/' . $cloudpath,
|
'$cloudpath' => z_root() . '/' . $encoded_path,
|
||||||
'$parentpath' => $parentpath,
|
'$parentpath' => $parentpath,
|
||||||
'$uid' => $channel['channel_id'],
|
'$uid' => $channel['channel_id'],
|
||||||
'$channelnick' => $channel['channel_address'],
|
'$channelnick' => $channel['channel_address'],
|
||||||
|
Reference in New Issue
Block a user