Commit da59f645 by Vitalik

Regex valid url

parent 0cd96e72
Pipeline #179 skipped
......@@ -124,8 +124,11 @@ function validate_url($url)
$url = 'http://' . $url;
}
$url = filter_var($url, FILTER_SANITIZE_URL);
$url = filter_var($url, FILTER_VALIDATE_URL);
preg_match("/[\\w]+(\\.[\\w]+)*(\\.[a-z]{2,6})/i", $url, $matches);
if (empty($matches[0])) {
$url = false;
}
return $url;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment