Fix bug oc-542, encode urls for private links
This commit is contained in:
parent
71423ec566
commit
e0a5f976e7
|
@ -19,7 +19,7 @@ while ($path != $userDirectory) {
|
||||||
$item['privateLink'] = $token;
|
$item['privateLink'] = $token;
|
||||||
} else {
|
} else {
|
||||||
// If in parent folder, include a path parameter to get direct access to file
|
// If in parent folder, include a path parameter to get direct access to file
|
||||||
$item['privateLink'] = $token.'&path='.substr($source, strlen($path));
|
$item['privateLink'] = $token.'&path='.str_replace('%2F', '/', str_replace('+', '%20', urlencode(substr($source, strlen($path)))));;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Check if uid_shared_with is a group
|
// Check if uid_shared_with is a group
|
||||||
|
|
|
@ -179,7 +179,7 @@ OC.Share={
|
||||||
$('#privateLinkCheckbox').attr('checked', true);
|
$('#privateLinkCheckbox').attr('checked', true);
|
||||||
var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&token='+token;
|
var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&token='+token;
|
||||||
if (token.indexOf('&path=') == -1) {
|
if (token.indexOf('&path=') == -1) {
|
||||||
link += '&file=' + item;
|
link += '&file=' + encodeURIComponent(item);
|
||||||
} else {
|
} else {
|
||||||
// Disable checkbox if inside a shared parent folder
|
// Disable checkbox if inside a shared parent folder
|
||||||
$('#privateLinkCheckbox').attr('disabled', 'true');
|
$('#privateLinkCheckbox').attr('disabled', 'true');
|
||||||
|
|
Loading…
Reference in New Issue