1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-06-27 16:36:00 +00:00

Protect delete_share with a CSRF token

This commit is contained in:
Yassine Guedidi 2025-03-23 13:13:11 +01:00
parent 0d8429dfc7
commit d1e128900a
3 changed files with 22 additions and 7 deletions

View file

@ -1185,12 +1185,19 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertSame(404, $client->getResponse()->getStatusCode());
// removing the share
$client->request('GET', '/share/delete/' . $content->getId());
$client->getContainer()->get(Config::class)->set('share_public', 1);
$this->logInAs('admin');
$crawler = $client->request('GET', '/view/' . $content->getId());
$client->submit($crawler->filter('.left-bar')->selectButton('entry.view.left_menu.delete_public_link')->form());
$this->assertSame(302, $client->getResponse()->getStatusCode());
// share is now disable
// share is now removed
$client->request('GET', '/share/' . $content->getUid());
$this->assertSame(404, $client->getResponse()->getStatusCode());
$client->getContainer()->get(Config::class)->set('share_public', 0);
}
/**