is_valid_url() accepts httpx:// and rejects uppercase HTTP://

Abierto
#1,546 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@elphizu ya está trabajando en esto.

Desde el 17/11/2026.

  • #1547 de @elphizu — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
php
Área
testing-qa

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 with http.
  • 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
  1. Set Plugin URI: HTTP://example.com/my-plugin in a plugin header and run Plugin Check. It reports an invalid URL.
  2. Change it to httpx://example.com/my-plugin or httpfoobar://example.com/my-plugin and run again. No error.
Environment

Plugin Check trunk (2.1.0-alpha), WordPress 6.3+, PHP 7.4+.

Lenguaje dominante
PHP
Estrellas
365
Forks
135
Merge medio
1 d 8 h
PR fusionados (30 d)
20

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de WordPress/plugin-check

Todos los issues de WordPress/plugin-check

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.