diff --git a/plugins/custer/filter_mail.php b/plugins/custer/filter_mail.php index 0208a95..781baca 100644 --- a/plugins/custer/filter_mail.php +++ b/plugins/custer/filter_mail.php @@ -125,8 +125,16 @@ function find_user_id_from_headers(&$args) { if (!isset($args['headers'])) { return null; } - $user_id = null; $headers = $args['headers']; + if (empty($headers)) { + return null; + } + if (!is_array($headers)) { + return null; + } + + $user_id = null; + // isset returns false if the key exists but its value is null : 'user_id'=>null : https://stackoverflow.com/questions/3803282/check-if-value-isset-and-null if (array_key_exists('user_id', $headers)) { $user_id = $headers['user_id'];