ProperEscapingFunctionSniff doesn't catch misuse of wp_json_encode
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
調査の方向性
まず WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php を読み、issue にある最小限の onerror の例を再現します。wp_json_encode が esc_html と比較してどのように扱われるかを比較します。そのコンテキストで誤用によって WordPressVIPMinimum.Security.ProperEscapingFunction エラーが発生すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bug Description
ProperEscapingFunctionSniff is a great addition to WPCS. It isn't comprehensive, though.
One specific example that I ran into is that it won't catch improper use of wp_json_encode() like it does with other functions.
Minimal Code Snippet
<!-- correctly flags esc_html as the wrong escaping function in this context -->
<img src=a onerror="<?php echo esc_html( $foo ); ?>" />
<!-- fails to catch that this is the wrong escaping function -->
<img src=a onerror="<?php echo wp_json_encode( $foo ); ?>" />
Error Code
WordPressVIPMinimum.Security.ProperEscapingFunction
- 主要言語
- PHP
- スター
- 261
- フォーク
- 44
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Automattic/VIP-Coding-Standards のほかの issue
-
AlwaysReturnInFilter: isInsideIfConditonal() guards the conditions array after reading it対応中かも @tomjn が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Bug: PreGetPosts warns when the early is_main_query() return is not the first statement in its if対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
-
Suppress filters in get_posts false positive対応中かも @tomjn が 5 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
Breaking Change Type: Maintenance
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Automattic/VIP-Coding-Standards#849 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
Automattic/VIP-Coding-Standards の issue をすべて見る
似ている issue
-
customer-support needs-triage Platform(Default)
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
grokability/snipe-it#19767 ·
メンテナーはふだん 1 日以内に返信
-
[Code Quality] SfxDownloader extract path has no destination-writability pre-check for cached zipsオープンpriority:low type:refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
crazy-goat/workerman-bundle#1052 ·
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信