aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-02-21 07:48:47 +0000
committerMario <mario@mariovavti.com>2019-02-21 12:10:31 +0100
commit93039081d58f368b977d237a0d546896a7385bbc (patch)
tree6391bddc1c3377e667482242e4536dde7f5665b2
parent89ee28f858e8abfd23dff94c280e5c4a03ab6153 (diff)
downloadvolse-hubzilla-93039081d58f368b977d237a0d546896a7385bbc.tar.gz
volse-hubzilla-93039081d58f368b977d237a0d546896a7385bbc.tar.bz2
volse-hubzilla-93039081d58f368b977d237a0d546896a7385bbc.zip
fix summary and use item_normal_search() for viewsrc so we can also view the source for articles, cards, etc.
(cherry picked from commit a0ad110cff00bc9c506f5e6b921e5bd350f98f98)
-rw-r--r--Zotlabs/Module/Viewsrc.php2
-rw-r--r--include/text.php7
2 files changed, 7 insertions, 2 deletions
diff --git a/Zotlabs/Module/Viewsrc.php b/Zotlabs/Module/Viewsrc.php
index b73d81283..3e49b9db4 100644
--- a/Zotlabs/Module/Viewsrc.php
+++ b/Zotlabs/Module/Viewsrc.php
@@ -25,7 +25,7 @@ class Viewsrc extends \Zotlabs\Web\Controller {
notice( t('Item not found.') . EOL);
}
- $item_normal = item_normal();
+ $item_normal = item_normal_search();
if(local_channel() && $item_id) {
$r = q("select id, mid, item_flags, mimetype, item_obscured, body, llink, plink from item where uid in (%d , %d) and id = %d $item_normal limit 1",
diff --git a/include/text.php b/include/text.php
index b017b038a..ad5f84b54 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1682,7 +1682,12 @@ function prepare_body(&$item,$attach = false,$opts = false) {
$s .= prepare_binary($item);
}
else {
- $s .= prepare_text($item['body'],$item['mimetype'], $opts);
+ if($item['summary']) {
+ $s .= prepare_text('[summary]' . $item['summary'] . '[/summary]' . $item['body'],$item['mimetype'],$opts);
+ }
+ else {
+ $s .= prepare_text($item['body'],$item['mimetype'], $opts);
+ }
}
$event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event_obj($item['obj']) : false);