Skip to content

Commit 26cafd6

Browse files
authored
unserialize() の更新を取り込み (#247)
* [PHP 8.4] unserialize() can throw a ValueError and TypeError を取り込み * unserialize.xml Specify a strict type for the allowed_classes element を取り込み * Fix table error を取り込み
1 parent b46a9cd commit 26cafd6

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

reference/var/functions/unserialize.xml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 3dbbc167de33c0214f454b1d0399a32c88127c10 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: d75036c386e37ce56dafb7607b72aedc3e33fe09 Maintainer: hirokawa Status: ready -->
44
<!-- Credits: mumumu -->
55
<refentry xml:id="function.unserialize" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -90,7 +90,7 @@
9090
<tbody>
9191
<row>
9292
<entry><literal>allowed_classes</literal></entry>
93-
<entry><type>mixed</type></entry>
93+
<entry><type>array|bool</type></entry>
9494
<entry>
9595
<simpara>
9696
受け付けるクラス名の配列を指定します。あらゆるクラスを拒否する場合は
@@ -145,10 +145,16 @@
145145

146146
<refsect1 role="errors">
147147
&reftitle.errors;
148-
<para>
148+
<simpara>
149149
オブジェクトは、
150150
アンシリアライズを実行するハンドラで <classname>Throwable</classname> をスローしても構いません。
151-
</para>
151+
</simpara>
152+
<simpara>
153+
PHP 8.4.0 以降では、<parameter>options</parameter> の <literal>allowed_classes</literal> 要素が
154+
クラス名の <type>array</type> でない場合、
155+
<function>unserialize</function> は <exceptionname>TypeError</exceptionname> と
156+
<exceptionname>ValueError</exceptionname> をスローします。
157+
</simpara>
152158
</refsect1>
153159

154160
<refsect1 role="changelog">
@@ -163,6 +169,15 @@
163169
</row>
164170
</thead>
165171
<tbody>
172+
<row>
173+
<entry>8.4.0</entry>
174+
<entry>
175+
<parameter>options</parameter> の <literal>allowed_classes</literal> 要素が
176+
クラス名の <type>array</type> でない場合、
177+
<exceptionname>TypeError</exceptionname> と <exceptionname>ValueError</exceptionname> を
178+
スローするようになりました。
179+
</entry>
180+
</row>
166181
<row>
167182
<entry>8.3.0</entry>
168183
<entry>

0 commit comments

Comments
 (0)