Blacklist plugin enabled by default (bug fixes will come)

This commit is contained in:
Mikael Nordfeldth 2017-04-25 20:43:31 +02:00
parent a53284fe4f
commit 5f24fc0986
2 changed files with 4 additions and 5 deletions

View File

@ -345,6 +345,7 @@ $default =
'default' => array(
'Activity' => array(),
'AntiBrute' => array(),
'Blacklist' => array(),
'Bookmark' => array(),
'ClientSideShorten' => array(),
'DefaultLayout' => array(),

View File

@ -27,9 +27,7 @@
* @link http://status.net/
*/
if (!defined('STATUSNET')) {
exit(1);
}
if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Plugin to prevent use of nicknames or URLs on a blacklist
@ -483,7 +481,7 @@ class BlacklistPlugin extends Plugin
*/
function onStartSubscribe(Profile $subscriber, Profile $other)
{
foreach (array($other->profileurl, $other->homepage) as $url) {
foreach ([$other->getUrl(), $other->getHomepage()] as $url) {
if (empty($url)) {
continue;
@ -499,7 +497,7 @@ class BlacklistPlugin extends Plugin
}
}
$nickname = $other->nickname;
$nickname = $other->getNickname();
if (!empty($nickname)) {
if (!$this->_checkNickname($nickname)) {