mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-09 18:23:18 +02:00
feature 2380: add URL for user comment
git-svn-id: http://piwigo.org/svn/trunk@17351 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -1692,4 +1692,20 @@ function mobile_theme()
|
||||
|
||||
return $is_mobile_theme;
|
||||
}
|
||||
|
||||
/**
|
||||
* check url format
|
||||
*/
|
||||
function url_check_format($url)
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.2.0') >= 0)
|
||||
{
|
||||
return filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)!==false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// http://mathiasbynens.be/demo/url-regex @imme_emosol
|
||||
return (bool)preg_match('@^https?://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s]*)?$@iS', $url);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user