1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-27 00:22:08 +01:00
Files
archived-doc-ja/reference/libxml/functions/libxml-disable-entity-loader.xml
Yoshinari Takaoka a4e8759e94 PHP 8.0 migration/deprecated: expand on libxml_disable_entity_loader()
The current text in the migration guide about the deprecation of `libxml_disable_entity_loader()` is misleading and can easily lead to the introduction of XXE vulnerable code.

In select circumstances, when `LIBXML_NOENT` is used, code can still be vulnerable to XXE attacks, even on PHP 8.0.
So I'm proposing to add an appropriate warning and mention the upgrade path in the migration guide.

Includes fixing a typo on the `libxml_disable_entity_loader()` page.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-04-17 23:20:22 +09:00

132 lines
3.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: f3b5475eebc9a79088559e506d90cd648404bf33 Maintainer: takagi Status: ready -->
<!-- Credits: mumumu -->
<refentry xml:id="function.libxml-disable-entity-loader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>libxml_disable_entity_loader</refname>
<refpurpose>外部エンティティの読み込み機能を無効にする</refpurpose>
</refnamediv>
<refsynopsisdiv>
&warn.deprecated.function-8-0-0;
</refsynopsisdiv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>libxml_disable_entity_loader</methodname>
<methodparam choice="opt"><type>bool</type><parameter>disable</parameter><initializer>&true;</initializer></methodparam>
</methodsynopsis>
<para>
外部エンティティ読み込み機能の有効/無効を切り替えます。
外部エンティティの読み込みを無効にすると、
XML文書を読み込む際に問題が起こる可能性があることに注意して下さい。
しかし、libxml 2.9.0 以降では、エンティティの置換はデフォルトで無効になっているため、
<constant>LIBXML_NOENT</constant> を使って内部エンティティの参照を解決する必要がない限り、
外部エンティティの読み込みを無効にする必要はありません。
一般的には、外部エンティティの読み込みを抑制するのであれば、
<function>libxml_set_external_entity_loader</function> を使うことが望ましいです。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>disable</parameter></term>
<listitem>
<para>
libxml を使用する拡張モジュール
(<xref linkend="book.dom" /><xref linkend="book.xmlwriter" />
および <xref linkend="book.xmlreader" />) で、外部エンティティの読み込み機能を
無効 (&true;) あるいは有効 (&false;) にします。
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
変更前の値を返します。
</para>
</refsect1>
<!--
<refsect1 role="errors">
&reftitle.errors;
<para>
When does this function issue E_* level errors, and/or throw exceptions.
</para>
</refsect1>
-->
<!--
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>libxml_disable_entity_loader</function> example</title>
<para>
Any text that describes the purpose of the example, or what
goes on in the example should be here.
</para>
<programlisting role="php">
<![CDATA[
<?php
/* ... */
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
...
]]>
</screen>
</example>
</para>
</refsect1>
-->
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>libxml_use_internal_errors</function></member>
<member><function>libxml_set_external_entity_loader</function></member>
<member><link linkend="libxml.constants"><constant>LIBXML_NOENT</constant> 定数</link></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->