]> git.mxchange.org Git - friendica.git/commitdiff
Return early if $a->user is absent in BaseModule
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 20 Aug 2020 13:32:20 +0000 (09:32 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 20 Aug 2020 13:32:20 +0000 (09:32 -0400)
- Address https://github.com/friendica/friendica/issues/8877#issuecomment-660266026

src/BaseModule.php

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