if (empty($profile) || $_SERVER['REQUEST_METHOD'] != 'POST') {
// TRANS: Client error.
- $this->clientError(_m('Could not favor notice! Please make sure your browser has cookies enabled.')
- );
- return;
+ $this->clientError(_m('Could not favor notice! Please make sure your browser has cookies enabled.'));
}
$id = $this->trimmed('notice');
if ($profile->hasFave($notice)) {
// TRANS: Client error.
$this->clientError(_m('This notice is already a favorite!'));
- return;
}
$fave = Fave::addNew($profile, $notice);
if (!$fave) {
// TRANS: Server error.
$this->serverError(_m('Could not create favorite.'));
- return;
}
$profile->blowFavesCache();
$disfavor = new AnonDisFavorForm($this, $notice);
$disfavor->show();
$this->elementEnd('body');
- $this->elementEnd('html');
+ $this->endHTML();
} else {
$this->returnToPrevious();
}