Skip to content

Commit de56904

Browse files
[PHP 8.4] xml,xsl関連機能の翻訳
1 parent 8dd96e4 commit de56904

20 files changed

+320
-61
lines changed

reference/libxml/constants.xml

Lines changed: 46 additions & 1 deletion
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: 8f6fd5c55ab10709a4ff8daf6140dea422c1363c Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: eae558e584a4e5f70e5d85b5cebc59e296399924 Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa,mumumu -->
55
<appendix xml:id="libxml.constants" xmlns="http://docbook.org/ns/docbook">
66
&reftitle.constants;
@@ -48,6 +48,12 @@
4848
<simpara>
4949
デフォルトのDTD属性
5050
</simpara>
51+
<caution>
52+
<simpara>
53+
DTD属性の読み込みを有効にすると、外部エンティティの取得が可能になります。
54+
これを防ぐために <constant>LIBXML_NO_XXE</constant> 定数を使用できます(PHP 8.4.0 以降、Libxml &gt;= 2.13.0 でのみ利用可能です)。
55+
</simpara>
56+
</caution>
5157
</listitem>
5258
</varlistentry>
5359
<varlistentry xml:id="constant.libxml-dtdload">
@@ -59,6 +65,12 @@
5965
<simpara>
6066
外部サブセットをロードする
6167
</simpara>
68+
<caution>
69+
<simpara>
70+
外部サブセットの読み込みを有効にすると、外部エンティティの取得が可能になります。
71+
これを防ぐために <constant>LIBXML_NO_XXE</constant> 定数を使用できます(PHP 8.4.0 以降、Libxml &gt;= 2.13.0 でのみ利用可能です)。
72+
</simpara>
73+
</caution>
6274
</listitem>
6375
</varlistentry>
6476
<varlistentry xml:id="constant.libxml-dtdvalid">
@@ -73,6 +85,7 @@
7385
<caution>
7486
<simpara>
7587
DTD の検証を有効にすると、XML外部エンティティ参照攻撃(XXE) を容易にしてしまうかもしれません。
88+
これを防ぐために <constant>LIBXML_NO_XXE</constant> 定数を使用できます(PHP 8.4.0 以降、Libxml &gt;= 2.13.0 でのみ利用可能です)。
7689
</simpara>
7790
</caution>
7891
</listitem>
@@ -228,6 +241,22 @@
228241
</note>
229242
</listitem>
230243
</varlistentry>
244+
<varlistentry xml:id="constant.libxml-no-xxe">
245+
<term>
246+
<constant>LIBXML_NO_XXE</constant>
247+
(<type>int</type>)
248+
</term>
249+
<listitem>
250+
<simpara>
251+
エンティティ置換を行う際、XML外部エンティティ参照(XXE)を無効にします
252+
</simpara>
253+
<note>
254+
<para>
255+
PHP 8.4.0 以降、Libxml &gt;= 2.13.0 の場合のみ有効
256+
</para>
257+
</note>
258+
</listitem>
259+
</varlistentry>
231260
<varlistentry xml:id="constant.libxml-nsclean">
232261
<term>
233262
<constant>LIBXML_NSCLEAN</constant>
@@ -274,6 +303,22 @@
274303
</note>
275304
</listitem>
276305
</varlistentry>
306+
<varlistentry xml:id="constant.libxml-recover">
307+
<term>
308+
<constant>LIBXML_RECOVER</constant>
309+
(<type>int</type>)
310+
</term>
311+
<listitem>
312+
<simpara>
313+
ドキュメントをパースする際、リカバリモードを有効にする。
314+
</simpara>
315+
<note>
316+
<para>
317+
PHP 8.4.0 以降でのみ有効
318+
</para>
319+
</note>
320+
</listitem>
321+
</varlistentry>
277322
<varlistentry xml:id="constant.libxml-xinclude">
278323
<term>
279324
<constant>LIBXML_XINCLUDE</constant>

reference/libxml/functions/libxml-disable-entity-loader.xml

Lines changed: 10 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: f3b5475eebc9a79088559e506d90cd648404bf33 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: eae558e584a4e5f70e5d85b5cebc59e296399924 Maintainer: takagi Status: ready -->
44
<!-- Credits: mumumu -->
55

66
<refentry xml:id="function.libxml-disable-entity-loader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -23,11 +23,15 @@
2323
外部エンティティ読み込み機能の有効/無効を切り替えます。
2424
外部エンティティの読み込みを無効にすると、
2525
XML文書を読み込む際に問題が起こる可能性があることに注意して下さい。
26-
しかし、libxml 2.9.0 以降では、エンティティの置換はデフォルトで無効になっているため、
27-
<constant>LIBXML_NOENT</constant> を使って内部エンティティの参照を解決する必要がない限り、
26+
</para>
27+
<para>
28+
libxml 2.9.0 以降では、エンティティの置換はデフォルトで無効になっているため、<constant>LIBXML_NOENT</constant>,
29+
<constant>LIBXML_DTDVALID</constant>, or <constant>LIBXML_DTDLOAD</constant>.
30+
を使って内部エンティティの参照を解決する必要がない限り、
2831
外部エンティティの読み込みを無効にする必要はありません。
2932
一般的には、外部エンティティの読み込みを抑制するのであれば、
3033
<function>libxml_set_external_entity_loader</function> を使うことが望ましいです。
34+
<constant>LIBXML_NO_XXE</constant> 定数を使ってこれを防ぐこともできます (PHP 8.4.0 以降、Libxml &gt;= 2.13.0 でのみ利用可能)。
3135
</para>
3236
</refsect1>
3337

@@ -102,7 +106,9 @@
102106
<simplelist>
103107
<member><function>libxml_use_internal_errors</function></member>
104108
<member><function>libxml_set_external_entity_loader</function></member>
105-
<member><link linkend="libxml.constants"><constant>LIBXML_NOENT</constant> 定数</link></member>
109+
<member>The <constant>LIBXML_NOENT</constant> 定数</member>
110+
<member>The <constant>LIBXML_DTDVALID</constant> 定数</member>
111+
<member>The <constant>LIBXML_NO_XXE</constant> 定数</member>
106112
</simplelist>
107113
</para>
108114
</refsect1>

reference/libxml/functions/libxml-set-streams-context.xml

Lines changed: 34 additions & 1 deletion
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: f90df97fa5ebfa6e7fcace04976900d6700467cc Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 81bc2b5f454f893206009e0e931a72c85a86ac63 Maintainer: hirokawa Status: ready -->
44
<refentry xml:id="function.libxml-set-streams-context" xmlns="http://docbook.org/ns/docbook">
55
<refnamediv>
66
<refname>libxml_set_streams_context</refname>
@@ -43,6 +43,39 @@
4343
</para>
4444
</refsect1>
4545

46+
<refsect1 role="errors">
47+
&reftitle.errors;
48+
<simpara>
49+
非ストリームリソースが <parameter>context</parameter> に渡された場合、
50+
<classname>TypeError</classname> をスローします。
51+
</simpara>
52+
</refsect1>
53+
54+
<refsect1 role="changelog">
55+
&reftitle.changelog;
56+
<informaltable>
57+
<tgroup cols="2">
58+
<thead>
59+
<row>
60+
<entry>&Version;</entry>
61+
<entry>&Description;</entry>
62+
</row>
63+
</thead>
64+
<tbody>
65+
<row>
66+
<entry>8.4.0</entry>
67+
<entry>
68+
<function>libxml_set_streams_context</function> は、
69+
<parameter>context</parameter> に非ストリームリソースが渡された場合、
70+
コンテキストが実際に使用されたときではなく、その場で
71+
<exceptionname>TypeError</exceptionname> をスローするようになりました。
72+
</entry>
73+
</row>
74+
</tbody>
75+
</tgroup>
76+
</informaltable>
77+
</refsect1>
78+
4679
<refsect1 role="examples">
4780
&reftitle.examples;
4881
<para>

reference/libxml/setup.xml

Lines changed: 3 additions & 3 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: 48ce43fe79fa0c9f31f187ea8ec995b4cb13037e Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: b8cefce03356afc96a205de76dac5c9770e78a9d Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa -->
55

66
<chapter xml:id="libxml.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -10,8 +10,8 @@
1010
<section xml:id="libxml.requirements">
1111
&reftitle.required;
1212
<para>
13-
この拡張モジュールは、PHP 8.0 以降では <link xlink:href="&url.libxml;">libxml</link> &gt;=
14-
2.9.0 が必要です。PHP 8.0 より前のバージョンでは、libxml &gt;= 2.6.0 が必要です。
13+
この拡張モジュールは、PHP 8.4.0 以降では <link xlink:href="&url.libxml;">libxml</link> &gt;=
14+
2.9.4 が、PHP 8.4.0 より前のバージョンでは、libxml &gt;= 2.9.0 が、PHP 8.0.0 より前のバージョンでは libxml &gt;= 2.6.0 が必要です。
1515
</para>
1616
</section>
1717
<!-- }}} -->

reference/simplexml/functions/simplexml-import-dom.xml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: d715365c098db000eaf7dcd987ee6093f6e83091 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 62514381ff35348ffc4061b691132e36adf96210 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka -->
55
<refentry xml:id="function.simplexml-import-dom" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
77
<refname>simplexml_import_dom</refname>
8-
<refpurpose>DOM ノードから <literal>SimpleXMLElement</literal> オブジェクトを取得する</refpurpose>
8+
<refpurpose>XML または HTML ノードから <literal>SimpleXMLElement</literal> オブジェクトを取得する</refpurpose>
99
</refnamediv>
1010
<refsect1 role="description">
1111
&reftitle.description;
@@ -56,6 +56,38 @@
5656
</para>
5757
</refsect1>
5858

59+
<refsect1 role="errors">
60+
&reftitle.errors;
61+
<simpara>
62+
非XMLまたは非HTMLの<parameter>node</parameter>が渡された場合、
63+
<classname>TypeError</classname>をスローします。
64+
</simpara>
65+
</refsect1>
66+
67+
<refsect1 role="changelog">
68+
&reftitle.changelog;
69+
<informaltable>
70+
<tgroup cols="2">
71+
<thead>
72+
<row>
73+
<entry>&Version;</entry>
74+
<entry>&Description;</entry>
75+
</row>
76+
</thead>
77+
<tbody>
78+
<row>
79+
<entry>8.4.0</entry>
80+
<entry>
81+
この関数は、非XMLまたは非HTMLの<parameter>node</parameter>が渡された場合、
82+
<classname>ValueError</classname> ではなく
83+
<classname>TypeError</classname> をスローするようになりました。
84+
</entry>
85+
</row>
86+
</tbody>
87+
</tgroup>
88+
</informaltable>
89+
</refsect1>
90+
5991
<refsect1 role="examples">
6092
&reftitle.examples;
6193
<para>

reference/xml/constants.xml

Lines changed: 14 additions & 1 deletion
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: 5e9500ddad6dbc2f1b01d7da8b53379c8b7c386c Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 9acfa18973f304f8f2d531f28dd12b12c2b84f8b Maintainer: takagi Status: ready -->
44
<appendix xml:id="xml.constants" xmlns="http://docbook.org/ns/docbook">
55
&reftitle.constants;
66
&extension.constants;
@@ -258,6 +258,19 @@
258258
</simpara>
259259
</listitem>
260260
</varlistentry>
261+
<varlistentry xml:id="constant.xml-option-parse-huge">
262+
<term>
263+
<constant>XML_OPTION_PARSE_HUGE</constant>
264+
(<type>int</type>)
265+
</term>
266+
<listitem>
267+
<simpara>
268+
PHP 8.4.0 以降で利用可能です。
269+
libxml2 &lt; 2.7.0 を利用している場合(例えは PHP 7.x)、
270+
このオプションはデフォルトで有効となり、無効化できません。
271+
</simpara>
272+
</listitem>
273+
</varlistentry>
261274
<varlistentry xml:id="constant.xml-option-target-encoding">
262275
<term>
263276
<constant>XML_OPTION_TARGET_ENCODING</constant>

reference/xml/functions/xml-parser-get-option.xml

Lines changed: 2 additions & 1 deletion
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: 9fb00a4cf8563ea56d53cb1f72e2856b68899646 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9acfa18973f304f8f2d531f28dd12b12c2b84f8b Maintainer: hirokawa Status: ready -->
44
<!-- Credits: mumumu -->
55
<refentry xml:id="function.xml-parser-get-option" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -37,6 +37,7 @@
3737
<listitem>
3838
<simpara>
3939
取得するオプション。<constant>XML_OPTION_CASE_FOLDING</constant>,
40+
<constant>XML_OPTION_PARSE_HUGE</constant>,
4041
<constant>XML_OPTION_SKIP_TAGSTART</constant>, <constant>XML_OPTION_SKIP_WHITE</constant>
4142
あるいは <constant>XML_OPTION_TARGET_ENCODING</constant> が使用可能です。
4243
詳細は <function>xml_parser_set_option</function> を参照ください。

reference/xml/functions/xml-parser-set-option.xml

Lines changed: 17 additions & 1 deletion
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: 9fb00a4cf8563ea56d53cb1f72e2856b68899646 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 9acfa18973f304f8f2d531f28dd12b12c2b84f8b Maintainer: hirokawa Status: ready -->
44
<refentry xml:id="function.xml-parser-set-option" xmlns="http://docbook.org/ns/docbook">
55
<refnamediv>
66
<refname>xml_parser_set_option</refname>
@@ -59,6 +59,16 @@
5959
</link> を有効にするかどうかを制御する。デフォルトで有効。
6060
</entry>
6161
</row>
62+
<row>
63+
<entry><constant>XML_OPTION_PARSE_HUGE</constant></entry>
64+
<entry>bool</entry>
65+
<entry>
66+
10 MB を超えるドキュメントの解析を許可する。
67+
この設定は DoS 攻撃に繋がる可能性があるため、
68+
ドキュメントサイズに制限を設けている場合にのみ有効にすべきです。
69+
libxml2 を使用している場合のみ利用可能です。
70+
</entry>
71+
</row>
6272
<row>
6373
<entry><constant>XML_OPTION_SKIP_TAGSTART</constant></entry>
6474
<entry>integer</entry>
@@ -136,6 +146,12 @@
136146
</row>
137147
</thead>
138148
<tbody>
149+
<row>
150+
<entry>8.4.0</entry>
151+
<entry>
152+
<constant>XML_OPTION_PARSE_HUGE</constant> が追加されました。
153+
</entry>
154+
</row>
139155
<row>
140156
<entry>8.3.0</entry>
141157
<entry>

reference/xml/functions/xml-set-character-data-handler.xml

Lines changed: 3 additions & 2 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: 5a14f904d231d294e2e5b4fb5d2fc4d2fd9eddee Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 9cd8eb0f11edb4e59fd22f723137bbb91d6ab64f Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa -->
55
<refentry xml:id="function.xml-set-character-data-handler" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -76,7 +76,8 @@
7676
</row>
7777
</thead>
7878
<tbody>
79-
&xml.changelog.parser-param;
79+
&xml.changelog.handler-param;
80+
&xml.changelog.parser-param;
8081
</tbody>
8182
</tgroup>
8283
</informaltable>

reference/xml/functions/xml-set-default-handler.xml

Lines changed: 3 additions & 2 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: 5a14f904d231d294e2e5b4fb5d2fc4d2fd9eddee Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 9cd8eb0f11edb4e59fd22f723137bbb91d6ab64f Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa -->
55
<refentry xml:id="function.xml-set-default-handler" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -76,7 +76,8 @@
7676
</row>
7777
</thead>
7878
<tbody>
79-
&xml.changelog.parser-param;
79+
&xml.changelog.handler-param;
80+
&xml.changelog.parser-param;
8081
</tbody>
8182
</tgroup>
8283
</informaltable>

reference/xml/functions/xml-set-element-handler.xml

Lines changed: 3 additions & 2 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: 5a14f904d231d294e2e5b4fb5d2fc4d2fd9eddee Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 9cd8eb0f11edb4e59fd22f723137bbb91d6ab64f Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa,mumumu -->
55
<refentry xml:id="function.xml-set-element-handler" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -124,7 +124,8 @@
124124
</row>
125125
</thead>
126126
<tbody>
127-
&xml.changelog.parser-param;
127+
&xml.changelog.handler-param;
128+
&xml.changelog.parser-param;
128129
</tbody>
129130
</tgroup>
130131
</informaltable>

reference/xml/functions/xml-set-end-namespace-decl-handler.xml

Lines changed: 3 additions & 2 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: 5a14f904d231d294e2e5b4fb5d2fc4d2fd9eddee Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 9cd8eb0f11edb4e59fd22f723137bbb91d6ab64f Maintainer: takagi Status: ready -->
44
<!-- CREDITS: hirokawa -->
55
<refentry xmlns="http://docbook.org/ns/docbook" xml:id='function.xml-set-end-namespace-decl-handler'>
66
<refnamediv>
@@ -81,7 +81,8 @@
8181
</row>
8282
</thead>
8383
<tbody>
84-
&xml.changelog.parser-param;
84+
&xml.changelog.handler-param;
85+
&xml.changelog.parser-param;
8586
</tbody>
8687
</tgroup>
8788
</informaltable>

0 commit comments

Comments
 (0)