is_valid_url() accepts httpx:// and rejects uppercase HTTP://
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- php
- Ambito
- testing-qa
Direzione di ricerca
Read includes/Traits/URL_Utils.php around is_valid_url() and inspect the tests for URL validation. Add cases for uppercase and mixed-case HTTP schemes and for httpx:// and httpfoo://, then run the relevant tests. Done means valid HTTP schemes are accepted regardless of case and schemes beginning with http but not equal to HTTP or HTTPS are rejected. A pull request is already open for this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
is_valid_url() in URL_Utils.php tests the raw string with str_starts_with( $url, 'http' ). That check is case-sensitive and only looks at the first four characters, so:
httpx://example.com/passes, because it starts withhttp.HTTP://example.com/fails, even though schemes are case-insensitive (RFC 3986).
The function is used for Plugin URI, Author URI and the readme Donate link.
Proposed Fix
Drop the prefix check and compare the lowercased parsed scheme to http and https. Add test cases for HTTP://, HtTpS://, httpx:// and httpfoo://.
Steps to reproduce
- Set
Plugin URI: HTTP://example.com/my-pluginin a plugin header and run Plugin Check. It reports an invalid URL. - Change it to
httpx://example.com/my-pluginorhttpfoobar://example.com/my-pluginand run again. No error.
Environment
Plugin Check trunk (2.1.0-alpha), WordPress 6.3+, PHP 7.4+.
- Lingua principale
- PHP
- Stelle
- 365
- Fork
- 135
- Merge medio
- 1g 8h
- PR unite (30g)
- 20
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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/plugin-check
-
False positive trademarked_term warning for "wc" inside the word "Flowchart"Forse già presa @anandrajaram21 l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
WordPress/plugin-check#1556 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add opt-in .distignore exclusions for local and CI scansForse già presa @jakaria-istauk l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
WordPress/plugin-check#1559 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
WordPress/plugin-check#1557 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
WordPress/plugin-check#1555 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
PHPErrorReportingSniff flags debug constants used as values in const declarationsForse già presa @elphizu l’ha presa 7 giorni fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 35/100
WordPress/plugin-check#1553 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WordPress/plugin-check
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ExpressionEngine/ExpressionEngine#5493 ·
I maintainer di solito rispondono entro 5 giorni
-
"Attempt to read property 'username' on null" error after a user is deletedForse già presa @dicksonlaw583 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
omeka/plugin-SimplePages#49 ·
-
Bug Status: Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
quantum-php/project#222 ·
-
support
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno