aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-02-25 15:09:31 +0000
committerMario <mario@mariovavti.com>2021-02-25 15:09:31 +0000
commitac6dec91f1d1f6e5744a760cf006e40e88dcc8ba (patch)
tree98b6ca3682b0de34e3a0073d820f385664cf2916 /include
parent373612a0465c924f5365d0e8d3a505da04b7a99f (diff)
parentf45ebfa2237536b0e5a0d23910d6ddfbb1040af0 (diff)
downloadvolse-hubzilla-ac6dec91f1d1f6e5744a760cf006e40e88dcc8ba.tar.gz
volse-hubzilla-ac6dec91f1d1f6e5744a760cf006e40e88dcc8ba.tar.bz2
volse-hubzilla-ac6dec91f1d1f6e5744a760cf006e40e88dcc8ba.zip
Merge branch 'dev' into 'dev'
Enable multimedia in podcasts See merge request hubzilla/core!1916
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php12
-rw-r--r--include/feedutils.php20
2 files changed, 16 insertions, 16 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/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 );
}
}