Return early if $a->user is absent in BaseModule

- Address https://github.com/friendica/friendica/issues/8877#issuecomment-660266026
This commit is contained in:
Hypolite Petovan 2020-08-20 09:32:20 -04:00
parent 40d12b85c4
commit b4d59c25a8

View File

@ -140,6 +140,10 @@ abstract class BaseModule
return false; return false;
} }
if (empty($a->user)) {
return false;
}
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename); $sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename);
return ($sec_hash == $x[1]); return ($sec_hash == $x[1]);