Forms get a second csrfToken field: two XPath expressions in document.php miss the @
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
system/core/document.phpで、issue は363行目と510行目の2つのXPath式を特定しています。それらの行の付近でfindOneXPathがどのように使われているかを読み、属性テストを修正した後、フォームの出力にCSRFトークンが1つ、エラーリストが1つ含まれていることを確認してください。issueにはnl/Start/editでの再現手順があります。重複したフィールドとリストがなくなったことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Problem. Every HTMLForm gets a second csrfToken input, and a form may get a second error list, because two XPath expressions in system/core/document.php test a child element instead of an attribute (the @ is missing):
- line 363:
$this->form_element->findOneXPath('input[name=csrfToken]')compares a child elementnamewith a child elementcsrfToken, so it never finds the existing token and always adds one more; - line 510:
findOneXPath(".//ul[class='form-errors']")compares a child elementclass, so it never finds the existing list and adds another one.
Steps to reproduce (fictional test site, main d97ab7b, PHP 8.2). Log in as an administrator and open nl/Start/edit: the page holds name="csrfToken" twice. Both carry the same value, so nothing breaks today, but the form markup is wrong and the second error list can show errors twice.
Proposed fix. input[@name='csrfToken'] and .//ul[@class='form-errors'].
Found while writing known-bug tests for #520.
🤖 Generated with Claude Code
- 主要言語
- JavaScript
- スター
- 5
- フォーク
- 9
- 平均マージ
- 18時間 49分
- マージ済み PR(30日)
- 13
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PlanBCode/hypha のほかの issue
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Type: Bug Usecase: De Stadsbron Value: Visitors
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PlanBCode/hypha#522 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
PlanBCode/hypha の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
mongoosejs/mquery#142 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Add toro4n to the data modeling tools対応中かも @henriklantzhedstrom-prog が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
neo4j/docs-getting-started#546 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 25 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libnativeapi/nativeapi#21 ·