aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-02-25 15:43:13 +0000
committerMario <mario@mariovavti.com>2021-02-25 15:43:13 +0000
commit36c9f9abff0d9d4c52d3307bb563d6fb5067ac7b (patch)
tree1aab8961f183e93a45ed13657d0e3588d89a60c5
parent8295ccdda75e2eefba0d377aaab7301f1c0760a2 (diff)
parent65892ba5554c9dd19873cba9281c90d3a2b6d733 (diff)
downloadvolse-hubzilla-36c9f9abff0d9d4c52d3307bb563d6fb5067ac7b.tar.gz
volse-hubzilla-36c9f9abff0d9d4c52d3307bb563d6fb5067ac7b.tar.bz2
volse-hubzilla-36c9f9abff0d9d4c52d3307bb563d6fb5067ac7b.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
-rw-r--r--include/bbcode.php12
-rw-r--r--include/channel.php9
-rw-r--r--include/feedutils.php20
3 files changed, 20 insertions, 21 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 5a71ada0c..a5ef6760b 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1530,18 +1530,18 @@ function bbcode($Text, $options = []) {
// html5 video and audio
if (strpos($Text,'[/video]') !== false) {
- $Text = preg_replace_callback("/\[video (.*?)\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mpeg|mpg))\[\/video\]/ism", 'videowithopts', $Text);
- $Text = preg_replace_callback("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mpeg|mpg))\[\/video\]/ism", 'tryzrlvideo', $Text);
+ $Text = preg_replace_callback("/\[video (.*?)\](.*?)\[\/video\]/ism", 'videowithopts', $Text);
+ $Text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", 'tryzrlvideo', $Text);
}
if (strpos($Text,'[/audio]') !== false) {
- $Text = preg_replace_callback("/\[audio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3|opus|m4a))\[\/audio\]/ism", 'tryzrlaudio', $Text);
+ $Text = preg_replace_callback("/\[audio\](.*?)\[\/audio\]/ism", 'tryzrlaudio', $Text);
}
if (strpos($Text,'[/zvideo]') !== false) {
- $Text = preg_replace_callback("/\[zvideo (.*?)\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mpeg|mpg))\[\/zvideo\]/ism", 'videowithopts', $Text);
- $Text = preg_replace_callback("/\[zvideo\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mpeg|mpg))\[\/zvideo\]/ism", 'tryzrlvideo', $Text);
+ $Text = preg_replace_callback("/\[zvideo (.*?)\](.*?)\[\/zvideo\]/ism", 'videowithopts', $Text);
+ $Text = preg_replace_callback("/\[zvideo\](.*?)\[\/zvideo\]/ism", 'tryzrlvideo', $Text);
}
if (strpos($Text,'[/zaudio]') !== false) {
- $Text = preg_replace_callback("/\[zaudio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3|opus|m4a))\[\/zaudio\]/ism", 'tryzrlaudio', $Text);
+ $Text = preg_replace_callback("/\[zaudio\](.*?)\[\/zaudio\]/ism", 'tryzrlaudio', $Text);
}
// SVG stuff
diff --git a/include/channel.php b/include/channel.php
index a3c1611a9..c6ca673eb 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -891,7 +891,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
unset($ret['channel']['channel_salt']);
}
if ($zap_compat) {
- unset($channel['channel_portable_id']);
+ unset($ret['channel']['channel_portable_id']);
}
}
@@ -899,7 +899,6 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
$r = q("select * from profile where uid = %d",
intval($channel_id)
);
-
if($r) {
$ret['profile'] = $r;
if ($zap_compat) {
@@ -1099,11 +1098,11 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
// @fixme - Not totally certain how to handle $zot_compat for the event timezone which exists
// in Hubzilla but is stored with the item and not the event. In Zap, stored information is
- // always UTC and localised on access as per standard conventions for working with global time data.
+ // always UTC and localised on access as per standard conventions for working with global time data.
// Older Zot (pre-Zot6) records aren't translated correctly w/r/t AS2 so only include events for the last year or so if
- // migrating to Zap.
-
+ // migrating to Zap.
+
$sqle = (($zap_compat) ? " and created > '2020-01-01 00:00:00' " : '');
$r = q("select * from event where uid = %d $sqle",
diff --git a/include/feedutils.php b/include/feedutils.php
index 352b8f038..9cb645ff8 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -722,17 +722,17 @@ function get_atom_elements($feed, $item) {
if(! $type)
$type = 'application/octet-stream';
- if($ostatus_protocol) {
- if((strpos($type,'image') === 0) && (strpos($res['body'], ']' . $link . '[/img]') === false) && (strpos($link,'http') === 0)) {
- $res['body'] .= "\n\n" . '[img]' . $link . '[/img]';
- }
- if((strpos($type,'video') === 0) && (strpos($res['body'], ']' . $link . '[/video]') === false) && (strpos($link,'http') === 0)) {
- $res['body'] .= "\n\n" . '[video]' . $link . '[/video]';
- }
- if((strpos($type,'audio') === 0) && (strpos($res['body'], ']' . $link . '[/audio]') === false) && (strpos($link,'http') === 0)) {
- $res['body'] .= "\n\n" . '[audio]' . $link . '[/audio]';
- }
+ // put media enclosures in bbcode markup
+ if((strpos($type,'image') === 0) && (strpos($res['body'], ']' . $link . '[/img]') === false) && (strpos($link,'http') === 0)) {
+ $res['body'] .= "\n\n" . '[img]' . $link . '[/img]';
+ }
+ if((strpos($type,'video') === 0) && (strpos($res['body'], ']' . $link . '[/video]') === false) && (strpos($link,'http') === 0)) {
+ $res['body'] .= "\n\n" . '[video]' . $link . '[/video]';
+ }
+ if((strpos($type,'audio') === 0) && (strpos($res['body'], ']' . $link . '[/audio]') === false) && (strpos($link,'http') === 0)) {
+ $res['body'] .= "\n\n" . '[audio]' . $link . '[/audio]';
}
+
$res['attach'][] = array('href' => $link, 'length' => $len, 'type' => $type, 'title' => $title );
}
}