From ed1ff81e948ca576ed439178c7d6482a09dc4140 Mon Sep 17 00:00:00 2001
From: Brion Vibber <brion@pobox.com>
Date: Tue, 13 Oct 2009 16:54:57 +0000
Subject: [PATCH] Include long-form attachment URL in notice if URL shortening
 is disabled. Previously, the attachment URL would simply be dropped when
 shortening returned false instead of a short URL... the attachment was
 present if you clicked through to notice details but didn't appear in the
 timeline, making it nigh-impossible to see the attachment.

---
 actions/newnotice.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/actions/newnotice.php b/actions/newnotice.php
index 00a822860e..115cfd580f 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -239,6 +239,10 @@ class NewnoticeAction extends Action
             $this->maybeAddRedir($fileRecord->id, $fileurl);
 
             $short_fileurl = common_shorten_url($fileurl);
+            if (!$short_fileurl) {
+                // todo -- Consider forcing default shortener if none selected?
+                $short_fileurl = $fileurl;
+            }
             $content_shortened .= ' ' . $short_fileurl;
 
             if (mb_strlen($content_shortened) > 140) {
-- 
2.39.5