forked from GNUsocial/gnu-social
NoProfileException collision avoidance fix
This commit is contained in:
parent
ba10da27da
commit
e83b2e147a
@ -2521,7 +2521,7 @@ class Notice extends Managed_DataObject
|
|||||||
$notice->_setProfile($map[$notice->profile_id]);
|
$notice->_setProfile($map[$notice->profile_id]);
|
||||||
}
|
}
|
||||||
} catch (NoProfileException $e) {
|
} catch (NoProfileException $e) {
|
||||||
common_log(LOG_WARNING, "Failed to fill profile in Notice with non-existing entry for profile_id: {$e->id}");
|
common_log(LOG_WARNING, "Failed to fill profile in Notice with non-existing entry for profile_id: {$e->profile_id}");
|
||||||
unset($notices[$entry]);
|
unset($notices[$entry]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,12 +45,12 @@ class NoProfileException extends ServerException
|
|||||||
|
|
||||||
public function __construct($profile_id, $msg=null)
|
public function __construct($profile_id, $msg=null)
|
||||||
{
|
{
|
||||||
$this->id = $profile_id;
|
$this->profile_id = $profile_id;
|
||||||
|
|
||||||
if ($msg === null) {
|
if ($msg === null) {
|
||||||
// TRANS: Exception text shown when no profile can be found for a user.
|
// TRANS: Exception text shown when no profile can be found for a user.
|
||||||
// TRANS: %1$s is a user nickname, $2$d is a user ID (number).
|
// TRANS: %u is a profile ID (number).
|
||||||
$msg = sprintf(_('There is no profile with id==%u'), $this->id);
|
$msg = sprintf(_('There is no profile with id==%u'), $this->profile_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::__construct($msg, 404);
|
parent::__construct($msg, 404);
|
||||||
|
Loading…
Reference in New Issue
Block a user