$list = new OCP\Template('files', 'part.list', '');\r
$list->assign('files', $files, false);\r
$list->assign('publicListView', true);\r
- $list->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'].'&path=', false);\r
- $list->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path=', false);\r
+ $list->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.urlencode($_GET['dir']).'&path=', false);\r
+ $list->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path=', false);\r
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '' );\r
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);\r
- $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'].'&path=', false);\r
+ $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.urlencode($_GET['dir']).'&path=', false);\r
$folder = new OCP\Template('files', 'index', '');\r
$folder->assign('fileList', $list->fetchPage(), false);\r
$folder->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);\r
} else {\r
$getPath = '';\r
}\r
- $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path='.$getPath);\r
+ $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path='.urlencode($getPath), false);\r
} else {\r
// Show file preview if viewer is available\r
$tmpl->assign('uidOwner', $uidOwner);\r
$tmpl->assign('filename', basename($path));\r
$tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));\r
if ($type == 'file') {\r
- $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&file='.$_GET['file'].'&download');\r
+ $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&file='.urlencode($_GET['file']).'&download', false);\r
} else {\r
if (isset($_GET['path'])) {\r
$getPath = $_GET['path'];\r
} else {\r
$getPath = '';\r
}\r
- $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path='.$getPath);\r
+ $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path='.$getPath, false);\r
}\r
}\r
$tmpl->printPage();\r