+ } elseif (
+ $target instanceof User &&
+ $performer->getBlock() instanceof Block &&
+ $performer->getBlock()->getBy() &&
+ $performer->getBlock()->getBy() === $target->getId()
+ ) {
+ // Allow users to block the user that blocked them.
+ // This is to prevent a situation where a malicious user
+ // blocks all other users. This way, the non-malicious
+ // user can block the malicious user back, resulting
+ // in a stalemate.
+ return true;
+