- Patch #10166 by jvandyk: bugfix: valid_url() believed that URLs with encoded spaces in them (eg. http://example.org/my%20file.html ) are not valid.

4.5.x
Dries Buytaert 2004-08-21 17:02:48 +00:00
parent cb3a404b75
commit 7736eb4995
1 changed files with 1 additions and 1 deletions

View File

@ -608,7 +608,7 @@ function valid_email_address($mail) {
*/
function valid_url($url, $absolute = FALSE) {
if ($absolute) {
return preg_match("/^(http|https|ftp):\/\/[a-z0-9\/:_\-_\.\?,~=#&]+$/i", $url);
return preg_match("/^(http|https|ftp):\/\/[a-z0-9\/:_\-_\.\?,~=#&%]+$/i", $url);
}
else {
return preg_match("/^[a-z0-9\/:_\-_\.,]+$/i", $url);