function checkNotice()
{
$content = common_shorten_links($_POST['omb_notice_content']);
- if (mb_strlen($content) > 140) {
- throw new Exception(_('The notice content is too long.'));
+ if (Notice::contentTooLong($content)) {
+ $this->clientError(_('Invalid notice content'), 400);
+ return false;
}
- return true;
+ $license = $_POST['omb_notice_license'];
+ $site_license = common_config('license', 'url');
+ if ($license && !common_compatible_license($license, $site_license)) {
+ throw new Exception(sprintf(_('Notice license ā%sā is not ' .
+ 'compatible with site license ā%sā.'),
+ $license, $site_license));
+ }
}
}
?>