]> source.dussan.org Git - nextcloud-server.git/commitdiff
Also disallow ; in remote urls
authorJoas Schilling <coding@schilljs.com>
Tue, 24 Mar 2020 13:20:15 +0000 (14:20 +0100)
committerJoas Schilling <coding@schilljs.com>
Tue, 14 Apr 2020 16:56:06 +0000 (18:56 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/files_sharing/lib/Controller/ExternalSharesController.php
apps/files_sharing/tests/Controller/ExternalShareControllerTest.php

index c5dd21cda30e8e0d158f9e6571bbb6c29979a107..96b9ebffac86d2c02813e64ef5ba013acf4c677c 100644 (file)
@@ -131,7 +131,7 @@ class ExternalSharesController extends Controller {
         * @return DataResponse
         */
        public function testRemote($remote) {
-               if (strpos($remote, '#') !== false || strpos($remote, '?') !== false) {
+               if (strpos($remote, '#') !== false || strpos($remote, '?') !== false || strpos($remote, ';') !== false) {
                        return new DataResponse(false);
                }
 
index 9d8ee9a9d4217a98db535f9237f34c0ecaa0f952..d6a4ee8d4f31097f23ea6083674e5a65b180e49d 100644 (file)
@@ -162,6 +162,7 @@ class ExternalShareControllerTest extends \Test\TestCase {
                return [
                        ['nextcloud.com?query'],
                        ['nextcloud.com/#anchor'],
+                       ['nextcloud.com/;tomcat'],
                ];
        }