Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一个关于Url 验证的问题 #194

Closed
denymz opened this issue Mar 24, 2019 · 1 comment
Closed

一个关于Url 验证的问题 #194

denymz opened this issue Mar 24, 2019 · 1 comment

Comments

@denymz
Copy link

denymz commented Mar 24, 2019

首先说一句抱歉,因为我的英语很不好。也非常感谢作者的这个项目,让我节省了很多时间!
不过今天在使用时在文档中发现了一个错误:
Link : http://validator.particle-php.com/en/latest/rules/#url

以下是文档中的一段演示代码 :
$v = new Validator;
$v->required('link')->url(['ftp://', 'ftps://']);
$v->validate(['link' => 'ftp://particle-php.com'])->isValid(); // true
$v->validate(['link' => 'http://validator.particle-php.com'])->isValid(); // false

不过这其中是存在问题的,上面这段代码的运行结果都是false;
因为在 Rule/Url.php 中的第79行 parse_url($value, PHP_URL_SCHEME) 的返回的结果中不会包括 ”://“

Thanks!

@denymz denymz closed this as completed Apr 4, 2019
@rick-nu
Copy link

rick-nu commented Apr 4, 2019

Sorry, English please 😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants