Skip to content

DOMDocument::xinclude(): Add a warning about untrusted input - #5862

Merged
DanielEScherzer merged 2 commits into
php:masterfrom
DanielEScherzer:domdocument-xinclude
Sep 18, 2026
Merged

DanielEScherzer merged 2 commits into
php:masterfrom
DanielEScherzer:domdocument-xinclude

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

No description provided.

</para>
</note>
<warning>
<simpara>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parentheses make it harder to read IMO. So, how about:

Avoid calling this method on untrusted XML, as XIncludes can include files from external websites or arbitrary local files, depending on whether the href attribute is a URL or a file:// path.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "depending on" part reads a bit confusingly, since it suggests that those are the only two options

I switched to saying "when" instead of "where" after reading it with fresh eyes, but I think the parentheses are needed for clarity

@DanielEScherzer
DanielEScherzer merged commit a809316 into php:master Sep 18, 2026
3 checks passed
@DanielEScherzer
DanielEScherzer deleted the domdocument-xinclude branch September 18, 2026 01:14
KentarouTakeda added a commit to php/doc-ja that referenced this pull request Sep 25, 2026
dom の 8 ファイルを原文の変更に追従しました。これで dom モジュールの未訳・要更新はなくなります。

- PHP 8.5 で `DOMNamedNodeMap`・`DOMNodeList`・`Dom\NamedNodeMap`・`Dom\NodeList`・`Dom\HTMLCollection`・`Dom\DtdNamedNodeMap` のオブジェクトをクローンすると失敗するようになったことが、各クラスの変更履歴に追加されました。あわせて `Dom\DtdNamedNodeMap`・`Dom\HTMLCollection`・`Dom\NamedNodeMap` の説明に、似たクラスとの関係が追記されました(php/doc-en@38fcf62、php/doc-en#5877)
- PHP 8.5 で `Dom\Element::getElementsByClassName()` が追加されたことが、`Dom\Element` の変更履歴に追加されました(php/doc-en@d4f96da、php/doc-en#5879)
- `DOMDocument::xinclude()` に、信頼できない XML に対して使わないよう求める警告が追加されました(php/doc-en@a809316、php/doc-en#5862)

## 対象ファイル

reference/dom/ (8) — domdocument/xinclude.xml, domnamednodemap.xml, domnodelist.xml, dom/dom-dtdnamednodemap.xml, dom/dom-element.xml, dom/dom-htmlcollection.xml, dom/dom-namednodemap.xml, dom/dom-nodelist.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants