JSON_ERROR_DEPTH with JSON_PARTIAL_OUTPUT_ON_ERROR.
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
Hi, json_encode, when it exceeds the max depth, having the flag JSON_PARTIAL_OUTPUT_ON_ERROR, just ignores the max depth and goes on. Shouldn't be a better choice to stop at that depth, replacing by null, for example, following the "partial output" sense as with JSON_ERROR_RECURSION?
Ignoring the optional depth limit seems a bug and truncating the chain of references with null, giving a partial output seems natural.
It seems a trivial change in the sources, thank you.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、設定された深さを超えるデータに対して JSON_PARTIAL_OUTPUT_ON_ERROR を指定した json_encode を再現し、その後 PHP のソースコード内の JSON エンコーディング実装を追跡します。深さの制限が守られ、出力が部分的になること(たとえば、深さを超えた値が null に置き換えられること)を確認し、このケースのリグレッションテストによるカバレッジが追加されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100