} else if (is_string($config)) {
return explode("\r\n", $config);
} else {
+ // TRANS: Exception thrown if the Blacklist plugin configuration is incorrect.
+ // TRANS: %1$s is a configuration section, %2$s is a configuration setting.
throw new Exception(sprintf(_m('Unknown data type for config %1$s + %2$s.'),$section, $setting));
}
}
*
* @return boolean hook value
*/
- function onStartRegistrationTry($action)
+ function onStartRegisterUser(&$user, &$profile)
{
- $homepage = strtolower($action->trimmed('homepage'));
+ $homepage = strtolower($profile->homepage);
if (!empty($homepage)) {
if (!$this->_checkUrl($homepage)) {
}
}
- $nickname = strtolower($action->trimmed('nickname'));
+ $nickname = strtolower($profile->nickname);
if (!empty($nickname)) {
if (!$this->_checkNickname($nickname)) {
}
}
- $nickname = strtolower($actor->poco->preferredUsername);
+ if (!empty($actor->poco)) {
+ $nickname = strtolower($actor->poco->preferredUsername);
- if (!empty($nickname)) {
- if (!$this->_checkNickname($nickname)) {
- // TRANS: Exception thrown trying to post a notice while having a blocked nickname. %s is the blocked nickname.
- $msg = sprintf(_m("Notices from nickname \"%s\" disallowed."),
- $nickname);
- throw new ClientException($msg);
+ if (!empty($nickname)) {
+ if (!$this->_checkNickname($nickname)) {
+ // TRANS: Exception thrown trying to post a notice while having a blocked nickname. %s is the blocked nickname.
+ $msg = sprintf(_m("Notices from nickname \"%s\" disallowed."),
+ $nickname);
+ throw new ClientException($msg);
+ }
}
}