summaryrefslogtreecommitdiff
path: root/actions/postnotice.php
diff options
context:
space:
mode:
authormillette <millette@controlyourself.ca>2008-11-28 16:01:14 -0500
committermillette <millette@controlyourself.ca>2008-11-28 16:01:14 -0500
commitce0883330306ccb9bd50aef4d7963351284bd698 (patch)
tree48797bd1dac83f1dd08e39a77f11540f53bed249 /actions/postnotice.php
parent4fca9960cd5388ff2a12472b956e2504a5af7549 (diff)
shorten urls for posts > 140 chars only, from anywhere. Only show long urls in title attributes for links we shortened ourselves.
darcs-hash:20081128210114-099f7-4e4cde0a983c2ac6d41efb59b46cb7dbf45dc7a6.gz
Diffstat (limited to 'actions/postnotice.php')
-rw-r--r--actions/postnotice.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/actions/postnotice.php b/actions/postnotice.php
index 243aa3163..243081f12 100644
--- a/actions/postnotice.php
+++ b/actions/postnotice.php
@@ -58,13 +58,11 @@ class PostnoticeAction extends Action {
return false;
}
$content = $req->get_parameter('omb_notice_content');
-// if (!$content || strlen($content) > 140) {
- $content = common_shorten_links($content);
- if (mb_strlen($content) > 140) {
- common_user_error(_('Invalid notice content'), 400);
- return false;
- }
-// }
+ $content_shortened = common_shorten_links($content);
+ if (mb_strlen($content_shortened) > 140) {
+ common_user_error(_('Invalid notice content'), 400);
+ return false;
+ }
$notice_uri = $req->get_parameter('omb_notice');
if (!Validate::uri($notice_uri) &&
!common_valid_tag($notice_uri)) {