Fix findings of the full security and bug scan
- Update Symfony to 7.4.24/25 and Twig to 3.31.1 (19 advisories), npm ws - Forms: honeypot no longer named "website" (a field labelled Website silently dropped every submission), reserve technical field names, keep single-line fields on one line - Installer: English installations stored pages under "en" and served 404 - Schedules from before ADR 116 no longer publish the latest draft - Moving a page: refuse reserved addresses, claim the version atomically - Content packages: check close(), require all media, verify extracted bytes, clean up on failure, clear the media mirror after import - Updater: failed copies in public/ and plugins/ abort and roll back public/ - Restore: missing media fail the restore; cms:restore keeps maintenance on - Editor preview honours the page's header and footer choice Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4a33090905
commit
33dc413ef6
22 files changed
+659
-246
No files matched your search
@@ -2991,6 +2991,21 @@ final class CmsTest extends TestCase
|
||||
self::assertSame($child, $this->db->fetchOne('SELECT parent_id FROM page WHERE id = ?', [$grandchild]));
|
||||
}
|
||||
|
||||
public function testAMoveThatLostTheRaceForTheVersionChangesNothing(): void
|
||||
{
|
||||
// Zwei gleichzeitige Verschiebungen lesen dieselbe Version. Nachgestellt: die erste ist
|
||||
// schon durch, die zweite kommt mit der alten Version und darf nicht überschreiben.
|
||||
$page = $this->publishedPage('beratung', 'Beratung');
|
||||
$version = $this->pages->findForEditor($page)['version'];
|
||||
$this->db->executeStatement('UPDATE page SET version = version + 1 WHERE id = ?', [$page]);
|
||||
try {
|
||||
$this->pages->movePage($page, 'anders', null, $version, $this->redirects);
|
||||
self::fail('Expected a stale write.');
|
||||
} catch (StaleWrite) {
|
||||
}
|
||||
self::assertSame('beratung', $this->db->fetchOne('SELECT path FROM page WHERE id = ?', [$page]));
|
||||
}
|
||||
|
||||
public function testMoveRefusesCyclesCollisionsAndTheHomePage(): void
|
||||
{
|
||||
$parent = $this->publishedPage('leistungen', 'Leistungen');
|
||||
@@ -3002,6 +3017,9 @@ final class CmsTest extends TestCase
|
||||
'into itself' => [$parent, 'leistungen', $parent],
|
||||
'onto a taken address' => [$other, 'leistungen', null],
|
||||
'with a slug that is no slug' => [$other, 'mit leerzeichen', null],
|
||||
// Beim Anlegen schon gesperrt, beim Verschieben fehlte die Prüfung.
|
||||
'onto the administration' => [$other, 'admin', null],
|
||||
'onto the media address' => [$other, 'media', null],
|
||||
];
|
||||
foreach ($cases as $name => [$page, $slug, $target]) {
|
||||
try {
|
||||
@@ -3869,6 +3887,12 @@ display: flex', '#b1{display:flex;color:red}'];
|
||||
// sonst lieferte der Webserver weiter aus, was die Anwendung nicht mehr kennt.
|
||||
$mirror = new \App\Content\MediaMirror($abbild, $this->path.'-media');
|
||||
self::assertSame(0, $mirror->prune());
|
||||
// Bringt ein Paket dieselbe Kennung mit anderem Inhalt, findet prune() nichts; deshalb
|
||||
// leert der Import das Abbild ganz, und es füllt sich beim nächsten Abruf wieder.
|
||||
self::assertSame(1, $mirror->clear());
|
||||
self::assertDirectoryDoesNotExist($abbild.'/'.$item['id']);
|
||||
$mirror->publish($item['id'], 480, $quelle);
|
||||
self::assertFileEquals($quelle, $ziel);
|
||||
unlink($quelle);
|
||||
file_put_contents($abbild.'/'.$item['id'].'/fremd.txt', 'gehört nicht hierher');
|
||||
self::assertSame(2, $mirror->prune());
|
||||
|
||||
Reference in new issue
Block a user