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

オープン
#1,546 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@elphizu がすでに取り組んでいます。

2026年11月17日 から。

  • #1547 @elphizu による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
php
領域
testing-qa

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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+.

主要言語
PHP
スター
365
フォーク
135
平均マージ
1日 8時間
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WordPress/plugin-check のほかの issue

WordPress/plugin-check の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。