fixes #547, strong checks on url format

This commit is contained in:
plegall
2016-11-17 13:43:40 +01:00
parent 25d2305839
commit b3157cbfd8
+10
View File
@@ -2055,6 +2055,16 @@ function mobile_theme()
*/
function url_check_format($url)
{
if (strpos($url, '"') !== false)
{
return false;
}
if (strncmp($url, 'http://', 7) !== 0 and strncmp($url, 'https://', 8) !== 0)
{
return false;
}
return filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)!==false;
}