- 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.
parent
cb3a404b75
commit
7736eb4995
|
@ -608,7 +608,7 @@ function valid_email_address($mail) {
|
||||||
*/
|
*/
|
||||||
function valid_url($url, $absolute = FALSE) {
|
function valid_url($url, $absolute = FALSE) {
|
||||||
if ($absolute) {
|
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 {
|
else {
|
||||||
return preg_match("/^[a-z0-9\/:_\-_\.,]+$/i", $url);
|
return preg_match("/^[a-z0-9\/:_\-_\.,]+$/i", $url);
|
||||||
|
|
Loading…
Reference in New Issue