is_valid_url() accepts httpx:// and rejects uppercase HTTP://
维护者通常 1 天内回复
评估
- 难度
- 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 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+.
- 主要语言
- PHP
- 星标
- 365
- 派生
- 135
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 20
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WordPress/plugin-check 的其他 Issue
-
False positive trademarked_term warning for "wc" inside the word "Flowchart"可能已有人在做 @anandrajaram21 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
WordPress/plugin-check#1556 · 1 条评论 ·
维护者通常 1 天内回复
-
Add opt-in .distignore exclusions for local and CI scans可能已有人在做 @jakaria-istauk 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 42/100
WordPress/plugin-check#1559 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 58/100
WordPress/plugin-check#1557 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
WordPress/plugin-check#1555 · 1 条评论 ·
维护者通常 1 天内回复
-
PHPErrorReportingSniff flags debug constants used as values in const declarations可能已有人在做 @elphizu 于 7 天前认领。 未关闭
难度 3/5 半天 新手友好度 35/100
WordPress/plugin-check#1553 ·
维护者通常 1 天内回复
查看 WordPress/plugin-check 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
ExpressionEngine/ExpressionEngine#5493 ·
维护者通常 5 天内回复
-
"Attempt to read property 'username' on null" error after a user is deleted可能已有人在做 @dicksonlaw583 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
omeka/plugin-SimplePages#49 ·
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
quantum-php/project#222 ·
-
support
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复