From 7e9de1fd07896b69f97c1db9f7eafffd7ff92aa2 Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Wed, 30 Aug 2017 11:25:42 +0200 Subject: [PATCH] Fix php notice --- lib/Models/Subscriber.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Models/Subscriber.php b/lib/Models/Subscriber.php index 91abbb86c2..23900198e3 100644 --- a/lib/Models/Subscriber.php +++ b/lib/Models/Subscriber.php @@ -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; }