summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-17 14:16:43 -0700
committerBrion Vibber <brion@pobox.com>2010-03-17 14:16:43 -0700
commita9c731798e2f82c4961240627b41b61e29e3aedd (patch)
tree99b32fba9a314e307754c70f29e6c738c07d4f43 /plugins
parentf797a10256969c0e3bf214967e5eafe8df886149 (diff)
Tweak to OStatus long message cropping: use original source notice URL for the link in the text version, don't shorten the link for the HTML so we can append params to it in JS.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 7b18fed9c..9d2be8abc 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -542,8 +542,7 @@ class Ostatus_profile extends Memcached_DataObject
}
$shortSummary = common_shorten_links($summary);
if (Notice::contentTooLong($shortSummary)) {
- $url = common_shorten_url(common_local_url('attachment',
- array('attachment' => $attachment->id)));
+ $url = common_shorten_url($sourceUrl);
$shortSummary = substr($shortSummary,
0,
Notice::maxContent() - (mb_strlen($url) + 2));
@@ -552,10 +551,12 @@ class Ostatus_profile extends Memcached_DataObject
// We mark up the attachment link specially for the HTML output
// so we can fold-out the full version inline.
+ $attachUrl = common_local_url('attachment',
+ array('attachment' => $attachment->id));
$rendered = common_render_text($shortSummary) .
' ' .
'<a href="' .
- htmlspecialchars($url) .
+ htmlspecialchars($attachUrl) .
'" class="attachment more">' .
// TRANS: expansion link for too-long remote messages
htmlspecialchars(_m('(more)')) .