Feature Request #4255
More strict URL Validation
| Status: | Closed | Start date: | 09/12/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | Core | |||
| Target version: | - | |||
| Resolution: | wontfix | Points: | 1 |
Description
Hi,
I've got some "troubles" with Kohanas URL validation, which is not strict enough for my purposes, and I think I am not alone with that ;-)
Currently, Kohana validates URLs based on http://www.apps.ietf.org/rfc/rfc1738.html#sec-5, which is fine, but I'd like to see an option to specify a specific scheme that the URL should be tested against.
Now I can pass "abc://def.ghi" to the Valid::url() method and receive a TRUE. That is correct, but I am missing an option to tell the valid method if it should check for an http:// scheme, or an ftp:// scheme and so on.
It'd be great if this could somehow be added :-)
History
Updated by Thorsten S 8 months ago
Dmitry T. wrote:
Why don't you want to use custom callbacks?
Well, I will have to, since it will take some time until this Feature Request is implemented, if it will be at all.
But I think it could be handy for quite a lot of people if you could specify an option to the frameworks function, and not having to code an callback by your own.
The RFC itself that Kohana follows specifies some URL schemes, so why not go with that and add an option to check for one of them specifically.
Updated by Thorsten S 8 months ago
- File valid.php added
Instead of writing a callback, I modified the Valid classes URL method a little bit. It's not brilliant, but doing its job as far as I can see.
Updated by Woody Gilk 4 months ago
- Category set to Core
- Status changed from New to Closed
- Assignee set to Woody Gilk
- Resolution set to wontfix
Use a custom callback, I don't see a reason for this.