X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FNotice.php;h=68602b1f7cbd8e3ac4568043250fac34731bfc4b;hb=4dad3191f65512b04894377541c4a041221ed9a2;hp=1c4858149269c6d78a25006cff0b3a3796ec9f49;hpb=b4e649fe906a793cd5e62d6390065ea5d41c40db;p=quix0rs-gnu-social.git diff --git a/classes/Notice.php b/classes/Notice.php index 1c48581492..68602b1f7c 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -125,7 +125,12 @@ class Notice extends Memcached_DataObject $profile = Profile::staticGet($profile_id); - $final = common_shorten_links($content); + $final = common_shorten_links($content); + + if (mb_strlen($final) > 140) { + common_log(LOG_INFO, 'Rejecting notice that is too long.'); + return _('Problem saving notice. Too long.'); + } if (!$profile) { common_log(LOG_ERR, 'Problem saving notice. Unknown user.'); @@ -747,16 +752,16 @@ class Notice extends Memcached_DataObject foreach (array_unique($match[1]) as $nickname) { /* XXX: remote groups. */ - $group = User_group::staticGet('nickname', $nickname); + $group = User_group::getForNickname($nickname); - if (!$group) { + if (empty($group)) { continue; } // we automatically add a tag for every group name, too $tag = Notice_tag::pkeyGet(array('tag' => common_canonical_tag($nickname), - 'notice_id' => $this->id)); + 'notice_id' => $this->id)); if (is_null($tag)) { $this->saveTag($nickname);