aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2021-02-24 11:38:38 -0800
committernobody <nobody@zotlabs.com>2021-02-24 11:38:38 -0800
commitbeb418b093913bcc9499dac2722d53dfdab4879d (patch)
tree739ca3d948cb5574c479289f54cdceba707c7f58 /include
parent0f89d2b8e06de56effc5e5f751c098a432e26e6a (diff)
parenta033c439f3486c6ce31fb5d680c363ce0582d451 (diff)
downloadvolse-hubzilla-beb418b093913bcc9499dac2722d53dfdab4879d.tar.gz
volse-hubzilla-beb418b093913bcc9499dac2722d53dfdab4879d.tar.bz2
volse-hubzilla-beb418b093913bcc9499dac2722d53dfdab4879d.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php25
-rw-r--r--include/channel.php5
-rw-r--r--include/cli_startup.php2
-rw-r--r--include/conversation.php2
-rw-r--r--include/items.php34
5 files changed, 43 insertions, 25 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 4580516a5..5a71ada0c 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -272,6 +272,26 @@ function bb_parse_crypt($match) {
return $Text;
}
+/**
+ * @brief Returns raw base64 encoded crypt content.
+ *
+ * @param array $match
+ * @return string
+ */
+function bb_parse_b64_crypt($match) {
+
+ if(empty($match[2]))
+ return;
+
+ $r .= '----- ENCRYPTED CONTENT -----' . PHP_EOL;
+ $r .= $match[2] . PHP_EOL;
+ $r .= '----- END ENCRYPTED CONTENT -----';
+
+ return $r;
+
+}
+
+
function bb_parse_app($match) {
$app = Zotlabs\Lib\Apps::app_decode($match[1]);
@@ -1204,9 +1224,12 @@ function bbcode($Text, $options = []) {
$Text = preg_replace("/([^\]\='".'"'."\;\/]|^|\#\^)(https?\:\/\/$urlchars+)/ismu", '$1<a href="$2" ' . $target . ' rel="nofollow noopener">$2</a>', $Text);
}
- if (strpos($Text,'[/share]') !== false) {
+ $count = 0;
+ while (strpos($Text,'[/share]') !== false && $count < 10) {
$Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism", 'bb_ShareAttributes', $Text);
+ $count ++;
}
+
if($tryoembed) {
if (strpos($Text,'[/url]') !== false) {
$Text = preg_replace_callback("/[^\^]\[url\]([$URLSearchString]*)\[\/url\]/ism", 'tryoembed', $Text);
diff --git a/include/channel.php b/include/channel.php
index 5843dacf9..34bf6aa79 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -891,19 +891,14 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
unset($ret['channel']['channel_salt']);
}
if ($zap_compat) {
- $channel['channel_guid_sig'] = 'sha256.' . $channel['channel_guid_sig'];
- $channel['channel_hash'] = $channel['channel_portable_id'];
unset($channel['channel_portable_id']);
}
-
-
}
if(in_array('channel',$sections) || in_array('profile',$sections)) {
$r = q("select * from profile where uid = %d",
intval($channel_id)
);
-
if($r) {
$ret['profile'] = $r;
if ($zap_compat) {
diff --git a/include/cli_startup.php b/include/cli_startup.php
index a4c1f629a..b9e7d124d 100644
--- a/include/cli_startup.php
+++ b/include/cli_startup.php
@@ -9,4 +9,4 @@ function cli_startup() {
sys_boot();
App::set_baseurl(get_config('system','baseurl'));
-} \ No newline at end of file
+}
diff --git a/include/conversation.php b/include/conversation.php
index b22093951..ae69b7a01 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1474,7 +1474,9 @@ function hz_status_editor($a, $x, $popup = false) {
'$nocomment' => ((array_key_exists('item',$x)) ? $x['item']['item_nocomment'] : 0),
'$clearloc' => $clearloc,
'$title' => ((x($x, 'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''),
+ '$summary' => ((x($x, 'summary')) ? htmlspecialchars($x['summary'], ENT_COMPAT,'UTF-8') : ''),
'$placeholdertitle' => ((x($x, 'placeholdertitle')) ? $x['placeholdertitle'] : t('Title (optional)')),
+ '$placeholdersummary' => ((x($x, 'placeholdersummary')) ? $x['placeholdersummary'] : t('Summary (optional)')),
'$catsenabled' => $catsenabled,
'$category' => ((x($x, 'category')) ? $x['category'] : ''),
'$placeholdercategory' => t('Categories (optional, comma-separated list)'),
diff --git a/include/items.php b/include/items.php
index 50645fac2..88f100e60 100644
--- a/include/items.php
+++ b/include/items.php
@@ -2745,10 +2745,13 @@ function tag_deliver($uid, $item_id) {
return;
}
+ /* this should not be required anymore due to the check above
if (strpos($item['body'],'[/share]')) {
logger('W2W post already shared');
return;
}
+ */
+
// group delivery via W2W
logger('rewriting W2W post for ' . $u[0]['channel_address']);
start_delivery_chain($u[0], $item, $item_id, 0, true, (($item['edited'] != $item['created']) || $item['item_deleted']));
@@ -3318,24 +3321,19 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
$arr['item_wall'] = 1;
$arr['item_thread_top'] = 1;
- if (strpos($item['body'], "[/share]") !== false) {
- $pos = strpos($item['body'], "[share");
- $bb = substr($item['body'], $pos);
- } else {
- $bb = "[share author='" . urlencode($item['author']['xchan_name']).
- "' profile='" . $item['author']['xchan_url'] .
- "' portable_id='" . $item['author']['xchan_hash'] .
- "' avatar='" . $item['author']['xchan_photo_s'] .
- "' link='" . $item['plink'] .
- "' auth='" . ((in_array($item['author']['xchan_network'], ['zot6','zot'])) ? 'true' : 'false') .
- "' posted='" . $item['created'] .
- "' message_id='" . $item['mid'] .
- "']";
- if($item['title'])
- $bb .= '[h3][b]'.$item['title'].'[/b][/h3]'."\r\n";
- $bb .= $item['body'];
- $bb .= "[/share]";
- }
+ $bb = "[share author='" . urlencode($item['author']['xchan_name']).
+ "' profile='" . $item['author']['xchan_url'] .
+ "' portable_id='" . $item['author']['xchan_hash'] .
+ "' avatar='" . $item['author']['xchan_photo_s'] .
+ "' link='" . $item['plink'] .
+ "' auth='" . ((in_array($item['author']['xchan_network'], ['zot6','zot'])) ? 'true' : 'false') .
+ "' posted='" . $item['created'] .
+ "' message_id='" . $item['mid'] .
+ "']";
+ if($item['title'])
+ $bb .= '[h3][b]'.$item['title'].'[/b][/h3]'."\r\n";
+ $bb .= $item['body'];
+ $bb .= "[/share]";
$arr['body'] = $bb;
$arr['term'] = $item['term'];