aboutsummaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorMikael Nordfeldth <mmn@hethane.se>2016-01-18 19:29:45 +0100
committerMikael Nordfeldth <mmn@hethane.se>2016-01-18 19:29:45 +0100
commit6c46a93a8196d5a4db4e843112e4c7d0d6dd5aad (patch)
treeb9ea63eb4a084b4753dcac00d1e750b0143c59c6 /classes
parent486a02d60db98d88552ea36aff6b163b0273465c (diff)
downloadgnu-social-6c46a93a8196d5a4db4e843112e4c7d0d6dd5aad.tar
gnu-social-6c46a93a8196d5a4db4e843112e4c7d0d6dd5aad.zip
Minor improvements on Notice::saveActivity
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 0fefb9b48a..7524b9ff69 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -754,7 +754,7 @@ class Notice extends Managed_DataObject
$options['uri'] = $act->id;
$options['url'] = $act->link;
} else {
- $actobj = count($act->objects)==1 ? $act->objects[0] : null;
+ $actobj = count($act->objects)===1 ? $act->objects[0] : null;
if (!is_null($actobj) && !empty($actobj->id)) {
$options['uri'] = $actobj->id;
if ($actobj->link) {
@@ -835,6 +835,10 @@ class Notice extends Managed_DataObject
$stored->rendered = $actor->isLocal() ? $content : common_purify($content);
// yeah, just don't use getRendered() here since it's not inserted yet ;)
$stored->content = common_strip_html($stored->rendered);
+ if (trim($stored->content) === '') {
+ // TRANS: Error message when the plain text content of a notice has zero length.
+ throw new ClientException(_('Empty notice content, will not save this.'));
+ }
// Maybe a missing act-time should be fatal if the actor is not local?
if (!empty($act->time)) {