ID: 39898 Updated by: [EMAIL PROTECTED] Reported By: soenke dot ruempler at northclick dot de -Status: Assigned +Status: Closed Bug Type: Filter related Operating System: Linux PHP Version: 5.2.0 Assigned To: iliaa New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2006-12-20 18:12:11] [EMAIL PROTECTED] Assign to Ilia, he has the time to do it (he is working on it now). The decision is: - remove option of having host & scheme optional - No option to make them optional (what you have is not a url then) - trim ------------------------------------------------------------------------ [2006-12-20 15:15:45] soenke dot ruempler at northclick dot de Ok, that sounds good - I extract the following points: * Don't rely on parse_url() * URL with special characters is NOT valid * URL with whitespaces at the start or end is valid and the whitespace is trimmed in the returned string. * scheme and host are required by default ("blahblub" not valid, at least "asdf://blahblub" needed * Maybe FLAGS to turn scheme and host validation OFF (if someone finds it useful). ------------------------------------------------------------------------ [2006-12-20 14:13:49] [EMAIL PROTECTED] "I mean, for validation (and not for sanitization) strings with "invalid" characters like newlines should simply not be validated" Yes, however the question is whether these characters can be considered as valid and ignored or invalid and returns false. Same applies if they are trailing characters. I'm in favour of returning false except for trailing chars (with trim applied by default). "FILTER_VALIDATE_URL is not intuitive by now. Every developer expects "blahblub" to be not valid. FILTER_VALIDATE_URL should have sheme and host required by default (and optional flags to turn it OFF), too." I agree. ------------------------------------------------------------------------ [2006-12-20 14:07:32] soenke dot ruempler at northclick dot de Hi Pierre, I mean, for validation (and not for sanitization) strings with "invalid" characters like newlines should simply not be validated. Regardless what any RFC says or could say - if my application checks an URL provided by user-input and relies on ext/filter, there could be many issues (maybe like passing the "valid" output to critical functions (system, header etcpp.). FILTER_VALIDATE_URL is not intuitive by now. Every developer expects "blahblub" to be not valid. FILTER_VALIDATE_URL should have sheme and host required by default (and optional flags to turn it OFF), too. ------------------------------------------------------------------------ [2006-12-20 13:02:11] [EMAIL PROTECTED] it uses parse_url without concatenating back the result. If we make it work like parse_url, white spaces will be replaced by '_', which is not a good thing either. However, given the RFC, we should simply ignore them (See "E. Recommendations for Delimiting URI in Context" in URI or URL RFC). Fix will be commited once we agreed on the best choice. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/39898 -- Edit this bug report at http://bugs.php.net/?id=39898&edit=1