Don't statically call Validate functions
This commit is contained in:
parent
62c6ed58ba
commit
edef6f929a
@ -281,19 +281,20 @@ class ActivityUtils
|
|||||||
static function validateUri($uri)
|
static function validateUri($uri)
|
||||||
{
|
{
|
||||||
// Check mailto: URIs first
|
// Check mailto: URIs first
|
||||||
|
$validate = new Validate();
|
||||||
|
|
||||||
if (preg_match('/^mailto:(.*)$/', $uri, $match)) {
|
if (preg_match('/^mailto:(.*)$/', $uri, $match)) {
|
||||||
return Validate::email($match[1], common_config('email', 'check_domain'));
|
return $validate->email($match[1], common_config('email', 'check_domain'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Validate::uri($uri)) {
|
if ($validate->uri($uri)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Possibly an upstream bug; tag: URIs aren't validated properly
|
// Possibly an upstream bug; tag: URIs aren't validated properly
|
||||||
// unless you explicitly ask for them. All other schemes are accepted
|
// unless you explicitly ask for them. All other schemes are accepted
|
||||||
// for basic URI validation without asking.
|
// for basic URI validation without asking.
|
||||||
if (Validate::uri($uri, array('allowed_scheme' => array('tag')))) {
|
if ($validate->uri($uri, array('allowed_scheme' => array('tag')))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user