reference/mbstring/functions/mb-check-encoding.xml
d2ff0abe1650703e8974acaa7674c678e587a696
...
...
@@ -3,18 +3,20 @@
3
3
<refentry xml:id="function.mb-check-encoding" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
4
<refnamediv>
5
5
<refname>mb_check_encoding</refname>
6
-
<refpurpose>Check if the string is valid for the specified encoding</refpurpose>
6
+
<refpurpose>Check if strings are valid for the specified encoding</refpurpose>
7
7
</refnamediv>
8
8

9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>bool</type><methodname>mb_check_encoding</methodname>
13
-
<methodparam choice="opt"><type>string</type><parameter>var</parameter><initializer>&null;</initializer></methodparam>
14
-
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>mb_internal_encoding()</initializer></methodparam>
13
+
<methodparam choice="opt"><type class="union"><type>array</type><type>string</type><type>null</type></type><parameter>value</parameter><initializer>&null;</initializer></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Checks if the specified byte stream is valid for the specified encoding.
18
+
If <parameter>value</parameter> is of type &array;, all keys and values are
19
+
validated recursively.
18
20
It is useful to prevent so-called "Invalid Encoding Attack".
19
21
</para>
20
22
<para>
...
...
@@ -26,12 +28,18 @@
26
28
<para>
27
29
<variablelist>
28
30
<varlistentry>
29
-
<term><parameter>var</parameter></term>
31
+
<term><parameter>value</parameter></term>
30
32
<listitem>
31
33
<para>
32
-
The byte stream to check. If it is omitted, this function checks
34
+
The byte stream or &array; to check. If it is omitted, this function checks
33
35
all the input from the beginning of the request.
34
36
</para>
37
+

38
+
<warning>
39
+
<para>
40
+
As of PHP 8.1.0, omitting this parameter or passing &null; is deprecated.
41
+
</para>
42
+
</warning>
35
43
</listitem>
36
44
</varlistentry>
37
45
<varlistentry>
...
...
@@ -53,8 +61,42 @@
53
61
</para>
54
62
</refsect1>
55
63

56
-
</refentry>
64
+
<refsect1 role="changelog">
65
+
&reftitle.changelog;
66
+
<informaltable>
67
+
<tgroup cols="2">
68
+
<thead>
69
+
<row>
70
+
<entry>&Version;</entry>
71
+
<entry>&Description;</entry>
72
+
</row>
73
+
</thead>
74
+
<tbody>
75
+
<row>
76
+
<entry>8.1.0</entry>
77
+
<entry>
78
+
Calling this function with &null; as <parameter>value</parameter> or without argument is deprecated.
79
+
</entry>
80
+
</row>
81
+
<row>
82
+
<entry>8.0.0</entry>
83
+
<entry>
84
+
<parameter>value</parameter> and <parameter>encoding</parameter> are nullable now.
85
+
</entry>
86
+
</row>
87
+
<row>
88
+
<entry>7.2.0</entry>
89
+
<entry>
90
+
This function now also accepts an &array; as <parameter>value</parameter>.
91
+
Formerly, only &string;s have been supported.
92
+
</entry>
93
+
</row>
94
+
</tbody>
95
+
</tgroup>
96
+
</informaltable>
97
+
</refsect1>
57
98

99
+
</refentry>
58
100
<!-- Keep this comment at the end of the file
59
101
Local variables:
60
102
mode: sgml
61
103