git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit acf52a30 authored by Evan Prodromou's avatar Evan Prodromou

Hide stuff if there's an exception getting the profile

parent 2879f0a4
......@@ -2454,7 +2454,11 @@ class Notice extends Managed_DataObject
if ($scope & Notice::FOLLOWER_SCOPE) {
try {
$author = $this->getProfile();
} catch (Exception $e) {
return false;
}
if (!Subscription::exists($profile, $author)) {
return false;
......@@ -2471,7 +2475,13 @@ class Notice extends Managed_DataObject
if (common_config('notice', 'hidespam')) {
try {
$author = $this->getProfile();
} catch(Exception $e) {
// If we can't get an author, keep it hidden.
// XXX: technically not spam, but, whatever.
return true;
}
if ($author->hasRole(Profile_role::SILENCED)) {
if (empty($profile) || (($profile->id !== $author->id) && (!$profile->hasRight(Right::REVIEWSPAM)))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment