diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-25 10:59:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 10:59:51 +0200 |
commit | 585fc700fa711170df711990f51f226ecd831ef7 (patch) | |
tree | f98ac03d106b67b17d9bbc3803e76fb9f8b7297f /tests/front/controller/admin | |
parent | 85b972baf67c61ebabf1ce332358e4dfd2456a4e (diff) | |
parent | abe033be855f76fde9e8576ce36460fbb23b1e57 (diff) | |
download | Shaarli-585fc700fa711170df711990f51f226ecd831ef7.tar.gz Shaarli-585fc700fa711170df711990f51f226ecd831ef7.tar.zst Shaarli-585fc700fa711170df711990f51f226ecd831ef7.zip |
Merge pull request #1560 from ArthurHoaro/fix/redirect-wrong-path
Fix invalid redirection using the path of an external domain
Diffstat (limited to 'tests/front/controller/admin')
-rw-r--r-- | tests/front/controller/admin/ManageShaareControllerTest/SaveBookmarkTest.php | 4 | ||||
-rw-r--r-- | tests/front/controller/admin/SessionFilterControllerTest.php | 8 |
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); |