We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 22633a5a authored by Evan Prodromou's avatar Evan Prodromou

can't subscribe to blacklisted domains/users

parent bec00094
...@@ -504,4 +504,38 @@ class BlacklistPlugin extends Plugin ...@@ -504,4 +504,38 @@ class BlacklistPlugin extends Plugin
return true; return true;
} }
/**
* Check URLs and homepages for blacklisted users.
*/
function onStartSubscribe($subscriber, $other)
{
foreach (array($other->profileurl, $other->homepage) as $url) {
if (empty($url)) {
continue;
}
$url = strtolower($url);
if (!$this->_checkUrl($url)) {
$msg = sprintf(_m("Users from '%s' blocked."),
$url);
throw new ClientException($msg);
}
}
$nickname = $other->nickname;
if (!empty($nickname)) {
if (!$this->_checkNickname($nickname)) {
$msg = sprintf(_m("Can't subscribe to nickname '%s'."),
$nickname);
throw new ClientException($msg);
}
}
return true;
}
} }
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