A database password with a quote or a backslash breaks wp-tests-config.php
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- PHP
- Stelle
- 77
- Fork
- 79
- Merge medio
- 4g 19h
- PR unite (30g)
- 3
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WordPress/phpunit-test-runner
-
The PHP version check in prepare.php still allows PHP 7.2 and 7.3Forse già presa @ekamran l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WordPress/phpunit-test-runner#359 ·
I maintainer di solito rispondono entro 2 giorni
-
make testrunner.sh in host-tools directoryForse già presa @iarif4u l’ha presa 18 giorni fa. ApertaContributorDay tooling WCUS26
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WordPress/phpunit-test-runner#260 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
create host-tools directory in root folderForse già presa @iarif4u l’ha presa 18 giorni fa. ApertaContributorDay tooling WCUS26
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
WordPress/phpunit-test-runner#259 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Error: Error uploading results: Invalid parameter(s): message (HTTP status 400)`Forse già presa @ekamran l’ha presa 20 giorni fa. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
WordPress/phpunit-test-runner#335 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement tooling WCUS26
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
WordPress/phpunit-test-runner#316 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di WordPress/phpunit-test-runner
Issue simili
-
Awaiting Triage enhancement / feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
macOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
beyondcode/herd-community#1774 ·
-
Successful AUTHORISATION for a transaction already set to "failed" is marked done without paying itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Adyen/adyen-shopware6#895 ·
I maintainer di solito rispondono entro 1 giorno
-
not confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno