get_html_translation_table() inconsistent results with ENT_XHTML?
オープン
まだ誰も着手していません。
Bug
Status: Needs Triage
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
The following code:
<?php
print_r(get_html_translation_table(HTML_SPECIALCHARS, ENT_QUOTES | ENT_SUBSTITUTE | ENT_XHTML, "UTF-8"));
print_r(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES | ENT_SUBSTITUTE | ENT_XHTML, "UTF-8"));
Resulted in this output:
Array
(
["] => "
[&] => &
['] => '
[<] => <
[>] => >
)
Array
(
["] => "
[&] => &
['] => '
[<] => <
[>] => >
[ ] =>
// ...
// ...
)
But I expected the specialchars table to be a subset of the entities table. The single quotes in the entities table is substituted using the decimal notation, while it uses the html5 named entity notation in the specialchars table.
PHP Version
PHP 5.4 to PHP 8.2
Operating System
mint/ubuntu 22.04
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、サポートされている PHP ビルド上で issue にある get_html_translation_table() の呼び出しを再現し、HTML_SPECIALCHARS と HTML_ENTITIES を ENT_XHTML と比較します。これらの flags に対する実装と既存のテストを追跡します。specialchars テーブルの引用符のマッピングが entities テーブルと一貫しており、単一引用符の表現も含まれていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100