A database password with a quote or a backslash breaks wp-tests-config.php
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
調査の方向性
Start by reading prepare.php where it writes wp-tests-config.php, then compare its value escaping with wp-admin/setup-config.php as described in the issue. Check the generated config with quote, backslash, and localhost-containing values, and verify that the table prefix is handled too. Done means generated settings preserve the supplied values and the test run and cleanup can read the config; a pull request is already open.
索引モデルが issue の本文から書いたものです。
説明
prepare.php writes WPT_DB_NAME, WPT_DB_USER, WPT_DB_PASSWORD and WPT_DB_HOST into single-quoted PHP strings in wp-tests-config.php without escaping them.
I ran the config-writing code of prepare.php on master (61491cb) with a few passwords:
WPT_DB_PASSWORD |
Result in wp-tests-config.php |
|---|---|
p'q"r$s#t u |
Parse error on line 42 |
endswith\ |
Parse error on line 43 |
two\\back |
No error, but DB_PASSWORD is two\back |
my-localhost-pw |
No error, but DB_PASSWORD is my-127.0.0.1:33348-pw |
The last one happens because the placeholders are replaced one after another with str_replace(), so the localhost placeholder also matches inside the password that was written a step earlier.
The same escaping problem applies to WPT_TABLE_PREFIX, which is written into $table_prefix in the generated config.
With the parse error, the test run fails, and cleanup-db.php cannot read the settings, so the test tables stay in the database. Randomly generated passwords can contain these characters.
WordPress escapes these values with addcslashes( $value, "\\'" ) when it writes wp-config.php in wp-admin/setup-config.php. I have a fix with a CI check and will open a pull request.
- 主要言語
- PHP
- スター
- 77
- フォーク
- 79
- 平均マージ
- 4日 19時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WordPress/phpunit-test-runner のほかの issue
-
The PHP version check in prepare.php still allows PHP 7.2 and 7.3対応中かも @ekamran が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
WordPress/phpunit-test-runner#359 ·
メンテナーはふだん 2 日以内に返信
-
make testrunner.sh in host-tools directory対応中かも @iarif4u が 19 日前に担当しました。 オープンContributorDay tooling WCUS26
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
WordPress/phpunit-test-runner#260 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
create host-tools directory in root folder対応中かも @iarif4u が 19 日前に担当しました。 オープンContributorDay tooling WCUS26
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
WordPress/phpunit-test-runner#259 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Error: Error uploading results: Invalid parameter(s): message (HTTP status 400)`対応中かも @ekamran が 21 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
WordPress/phpunit-test-runner#335 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
enhancement tooling WCUS26
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
WordPress/phpunit-test-runner#316 ·
メンテナーはふだん 2 日以内に返信
WordPress/phpunit-test-runner の issue をすべて見る
似ている issue
-
needs-triage Platform(Default)
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[Sync EN] Document Error thrown by shm_* functions on a detached segment (#5975)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンsync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
Перевод устарел
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100