Fix php notice

This commit is contained in:
Pavel Dohnal
2017-08-30 11:25:42 +02:00
parent 7ac5e65963
commit 7e9de1fd07

View File

@ -149,7 +149,11 @@ class Subscriber extends Model {
static function generateToken($email = null) {
if($email !== null) {
return substr(md5(AUTH_KEY . $email), 0, self::SUBSCRIBER_TOKEN_LENGTH);
$auth_key = '';
if(defined('AUTH_KEY')) {
$auth_key = AUTH_KEY;
}
return substr(md5($auth_key . $email), 0, self::SUBSCRIBER_TOKEN_LENGTH);
}
return false;
}