]> source.dussan.org Git - nextcloud-server.git/commitdiff
urlencode
authorLukas Reschke <lukas@statuscode.ch>
Wed, 24 Oct 2012 15:58:48 +0000 (17:58 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Wed, 24 Oct 2012 15:58:52 +0000 (17:58 +0200)
apps/files_sharing/public.php

index db10a8faeee3937eccda93e30bd72b46fea562d0..534f548fb3c44c893b38c830eb3138609ff62a60 100644 (file)
@@ -168,11 +168,11 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
                                        $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
@@ -194,7 +194,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
                                        } 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
@@ -202,14 +202,14 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
                                        $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