aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller/admin
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-22 15:17:13 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-22 15:37:26 +0200
commitabe033be855f76fde9e8576ce36460fbb23b1e57 (patch)
treeeefc804a0cb8c0497a03c954667fd3e75598d0aa /tests/front/controller/admin
parent5baafe5001ef2fbe88d3fcdcc225ec12edd3fef1 (diff)
downloadShaarli-abe033be855f76fde9e8576ce36460fbb23b1e57.tar.gz
Shaarli-abe033be855f76fde9e8576ce36460fbb23b1e57.tar.zst
Shaarli-abe033be855f76fde9e8576ce36460fbb23b1e57.zip
Fix invalid redirection using the path of an external domain
Fixes #1554
Diffstat (limited to 'tests/front/controller/admin')
-rw-r--r--tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php4
-rw-r--r--tests/front/controller/admin/SessionFilterControllerTest.php8
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php b/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
index dabcd60d..58eaaa9b 100644
--- a/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
+++ b/tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php
@@ -43,7 +43,7 @@ class SaveBookmarkTest extends TestCase
43 'lf_description' => 'Provided description.', 43 'lf_description' => 'Provided description.',
44 'lf_tags' => 'abc def', 44 'lf_tags' => 'abc def',
45 'lf_private' => '1', 45 'lf_private' => '1',
46 'returnurl' => 'http://shaarli.tld/subfolder/admin/add-shaare' 46 'returnurl' => 'http://shaarli/subfolder/admin/add-shaare'
47 ]; 47 ];
48 48
49 $request = $this->createMock(Request::class); 49 $request = $this->createMock(Request::class);
@@ -124,7 +124,7 @@ class SaveBookmarkTest extends TestCase
124 'lf_description' => 'Provided description.', 124 'lf_description' => 'Provided description.',
125 'lf_tags' => 'abc def', 125 'lf_tags' => 'abc def',
126 'lf_private' => '1', 126 'lf_private' => '1',
127 'returnurl' => 'http://shaarli.tld/subfolder/?page=2' 127 'returnurl' => 'http://shaarli/subfolder/?page=2'
128 ]; 128 ];
129 129
130 $request = $this->createMock(Request::class); 130 $request = $this->createMock(Request::class);
diff --git a/tests/front/controller/admin/SessionFilterControllerTest.php b/tests/front/controller/admin/SessionFilterControllerTest.php
index d306c6e9..c4253167 100644
--- a/tests/front/controller/admin/SessionFilterControllerTest.php
+++ b/tests/front/controller/admin/SessionFilterControllerTest.php
@@ -31,7 +31,7 @@ class SessionFilterControllerTest extends TestCase
31 { 31 {
32 $arg = ['visibility' => 'private']; 32 $arg = ['visibility' => 'private'];
33 33
34 $this->container->environment = ['HTTP_REFERER' => 'http://shaarli/subfolder/controller/?searchtag=abc']; 34 $this->container->environment['HTTP_REFERER'] = 'http://shaarli/subfolder/controller/?searchtag=abc';
35 35
36 $this->container->loginManager->method('isLoggedIn')->willReturn(true); 36 $this->container->loginManager->method('isLoggedIn')->willReturn(true);
37 $this->container->sessionManager 37 $this->container->sessionManager
@@ -57,7 +57,7 @@ class SessionFilterControllerTest extends TestCase
57 { 57 {
58 $arg = ['visibility' => 'private']; 58 $arg = ['visibility' => 'private'];
59 59
60 $this->container->environment = ['HTTP_REFERER' => 'http://shaarli/subfolder/controller/?searchtag=abc']; 60 $this->container->environment['HTTP_REFERER'] = 'http://shaarli/subfolder/controller/?searchtag=abc';
61 61
62 $this->container->loginManager->method('isLoggedIn')->willReturn(true); 62 $this->container->loginManager->method('isLoggedIn')->willReturn(true);
63 $this->container->sessionManager 63 $this->container->sessionManager
@@ -121,7 +121,7 @@ class SessionFilterControllerTest extends TestCase
121 { 121 {
122 $arg = ['visibility' => 'test']; 122 $arg = ['visibility' => 'test'];
123 123
124 $this->container->environment = ['HTTP_REFERER' => 'http://shaarli/subfolder/controller/?searchtag=abc']; 124 $this->container->environment['HTTP_REFERER'] = 'http://shaarli/subfolder/controller/?searchtag=abc';
125 125
126 $this->container->loginManager->method('isLoggedIn')->willReturn(true); 126 $this->container->loginManager->method('isLoggedIn')->willReturn(true);
127 $this->container->sessionManager 127 $this->container->sessionManager
@@ -151,7 +151,7 @@ class SessionFilterControllerTest extends TestCase
151 { 151 {
152 $arg = ['visibility' => 'test']; 152 $arg = ['visibility' => 'test'];
153 153
154 $this->container->environment = ['HTTP_REFERER' => 'http://shaarli/subfolder/controller/?searchtag=abc']; 154 $this->container->environment['HTTP_REFERER'] = 'http://shaarli/subfolder/controller/?searchtag=abc';
155 155
156 $this->container->loginManager = $this->createMock(LoginManager::class); 156 $this->container->loginManager = $this->createMock(LoginManager::class);
157 $this->container->loginManager->method('isLoggedIn')->willReturn(false); 157 $this->container->loginManager->method('isLoggedIn')->willReturn(false);