Add FILTER_VALIDATE_STRLEN for UTF-8 string length validation
还没有人认领这个 Issue。
评估
调研方向
首先检查随附的原型实现和现有的过滤器验证器入口点。检查 min_len、max_len、default、UTF-8 代码点计数和 no-mbstring 的要求,然后验证验证器是否一致地处理该示例及其边界情况。
由索引模型根据 Issue 内容生成。
描述
Description
I would like to propose a new filter validator FILTER_VALIDATE_STRLEN that validates the length of a UTF-8 string.
The length is counted in Unicode code points. Grapheme clusters are not considered.
The validator supports min_len and max_len options and does not depend on the mbstring extension.
A prototype implementation is provided in the accompanying pull request.
$options = [
'options' => [
'max_len' => 2,
'default' => 'error',
],
];
var_dump(
filter_var('🐘🐘🐘', FILTER_VALIDATE_STRLEN, $options)
);
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.2k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 103
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
php/php-src 的其他 Issue
-
Bug SAPI: cli_server Status: Verified
难度 2/5 1-3 小时 新手友好度 88/100
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 76/100
-
Bug Status: Needs Triage
难度 1/5 1 小时以内 新手友好度 90/100
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 78/100
-
Bug Category: Tests Status: Verified
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
HarbourMasters/Shipwright#7229 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 条评论 ·