Skip to content

Commit 2379027

Browse files
committed
Changed data column type from text to blob to handle null-byte (\0) in serialized RBAC rule properly
Closes #12681
1 parent a246b1b commit 2379027

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

framework/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ Yii Framework 2 Change Log
8484
- Bug #12605: Make 'safe' validator work on write-only properties (arthibald, CeBe)
8585
- Bug #12629: Fixed `yii\widgets\ActiveField::widget()` to call `adjustLabelFor()` for `InputWidget` descendants (coderlex)
8686
- Bug #12649: Fixed consistency of `indexBy` handling for `yii\db\Query::column()` (silverfire)
87+
- Bug #11921: Fixed URL decoding in `yii.getQueryParams()` to handle `+` (plus) character properly (silverfire)
88+
- Bug #12681: Changed `data` column type from `text` to `blob` to handle null-byte (`\0`) in serialized RBAC rule properly (silverfire)
8789
- Enh #384: Added ability to run migration from several locations via `yii\console\controllers\BaseMigrateController::$migrationNamespaces` (klimov-paul)
8890
- Enh #6996: Added `yii\web\MultipartFormDataParser`, which allows proper processing of 'multipart/form-data' encoded non POST requests (klimov-paul)
8991
- Enh #8719: Add support for HTML5 attributes on submitbutton (formaction/formmethod...) for ActiveForm (VirtualRJ)

framework/rbac/migrations/m140506_102106_rbac_init.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function up()
5353

5454
$this->createTable($authManager->ruleTable, [
5555
'name' => $this->string(64)->notNull(),
56-
'data' => $this->text(),
56+
'data' => $this->binary(),
5757
'created_at' => $this->integer(),
5858
'updated_at' => $this->integer(),
5959
'PRIMARY KEY (name)',
@@ -64,7 +64,7 @@ public function up()
6464
'type' => $this->smallInteger()->notNull(),
6565
'description' => $this->text(),
6666
'rule_name' => $this->string(64),
67-
'data' => $this->text(),
67+
'data' => $this->binary(),
6868
'created_at' => $this->integer(),
6969
'updated_at' => $this->integer(),
7070
'PRIMARY KEY (name)',

framework/rbac/migrations/schema-mssql.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ drop table [auth_rule];
1717
create table [auth_rule]
1818
(
1919
[name] varchar(64) not null,
20-
[data] text,
20+
[data] blob,
2121
[created_at] integer,
2222
[updated_at] integer,
2323
primary key ([name])
@@ -29,7 +29,7 @@ create table [auth_item]
2929
[type] smallint not null,
3030
[description] text,
3131
[rule_name] varchar(64),
32-
[data] text,
32+
[data] blob,
3333
[created_at] integer,
3434
[updated_at] integer,
3535
primary key ([name]),
@@ -89,4 +89,4 @@ CREATE TRIGGER dbo.trigger_auth_item_child
8989
DELETE FROM dbo.[auth_item_child] WHERE parent IN (SELECT name FROM deleted) OR child IN (SELECT name FROM deleted);
9090
DELETE FROM dbo.[auth_item] WHERE name IN (SELECT name FROM deleted);
9191
END
92-
END;
92+
END;

framework/rbac/migrations/schema-mysql.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ drop table if exists `auth_rule`;
1717
create table `auth_rule`
1818
(
1919
`name` varchar(64) not null,
20-
`data` text,
20+
`data` blob,
2121
`created_at` integer,
2222
`updated_at` integer,
2323
primary key (`name`)
@@ -29,7 +29,7 @@ create table `auth_item`
2929
`type` smallint not null,
3030
`description` text,
3131
`rule_name` varchar(64),
32-
`data` text,
32+
`data` blob,
3333
`created_at` integer,
3434
`updated_at` integer,
3535
primary key (`name`),

framework/rbac/migrations/schema-oci.sql

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ drop table "auth_rule";
1818
create table "auth_rule"
1919
(
2020
"name" varchar(64) not null,
21-
"data" varchar(1000),
21+
"data" BYTEA,
2222
"created_at" integer,
2323
"updated_at" integer,
2424
primary key ("name")
@@ -31,8 +31,7 @@ create table "auth_item"
3131
"type" smallint not null,
3232
"description" varchar(1000),
3333
"rule_name" varchar(64),
34-
"data" varchar(1000),
35-
"created_at" integer,
34+
"data" BYTEA,
3635
"updated_at" integer,
3736
foreign key ("rule_name") references "auth_rule"("name") on delete set null,
3837
primary key ("name")

framework/rbac/migrations/schema-pgsql.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ drop table if exists "auth_rule";
1717
create table "auth_rule"
1818
(
1919
"name" varchar(64) not null,
20-
"data" text,
20+
"data" bytea,
2121
"created_at" integer,
2222
"updated_at" integer,
2323
primary key ("name")
@@ -29,7 +29,7 @@ create table "auth_item"
2929
"type" smallint not null,
3030
"description" text,
3131
"rule_name" varchar(64),
32-
"data" text,
32+
"data" bytea,
3333
"created_at" integer,
3434
"updated_at" integer,
3535
primary key ("name"),

framework/rbac/migrations/schema-sqlite.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ drop table if exists "auth_rule";
1717
create table "auth_rule"
1818
(
1919
"name" varchar(64) not null,
20-
"data" text,
20+
"data" blob,
2121
"created_at" integer,
2222
"updated_at" integer,
2323
primary key ("name")
@@ -29,7 +29,7 @@ create table "auth_item"
2929
"type" smallint not null,
3030
"description" text,
3131
"rule_name" varchar(64),
32-
"data" text,
32+
"data" blob,
3333
"created_at" integer,
3434
"updated_at" integer,
3535
primary key ("name"),

0 commit comments

Comments
 (0)