Skip to content

Commit 28162a0

Browse files
committed
Add missing CakePHP schema classes to unserialize allowlist
TableSchema contains nested Column, Index, Constraint and other schema objects that also need to be allowed for deserialization.
1 parent a419923 commit 28162a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Command/BakeMigrationDiffCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@
2020
use Cake\Console\ConsoleOptionParser;
2121
use Cake\Database\Connection;
2222
use Cake\Database\Schema\CachedCollection;
23+
use Cake\Database\Schema\CheckConstraint;
2324
use Cake\Database\Schema\CollectionInterface;
25+
use Cake\Database\Schema\Column;
26+
use Cake\Database\Schema\Constraint;
27+
use Cake\Database\Schema\ForeignKey;
28+
use Cake\Database\Schema\Index;
2429
use Cake\Database\Schema\TableSchema;
30+
use Cake\Database\Schema\UniqueKey;
2531
use Cake\Datasource\ConnectionManager;
2632
use Cake\Event\Event;
2733
use Cake\Event\EventManager;
@@ -554,6 +560,12 @@ protected function getDumpSchema(Arguments $args): array
554560
'allowed_classes' => [
555561
TableSchema::class,
556562
CachedCollection::class,
563+
Column::class,
564+
Index::class,
565+
Constraint::class,
566+
UniqueKey::class,
567+
ForeignKey::class,
568+
CheckConstraint::class,
557569
],
558570
]);
559571
}

0 commit comments

Comments
 (0)