aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php12
-rw-r--r--include/feedutils.php20
-rw-r--r--include/nav.php9
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/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 );
}
}
diff --git a/include/nav.php b/include/nav.php
index 1ad8dad58..994f7e0c0 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -295,11 +295,10 @@ function nav($template = 'default') {
foreach ($syslist as $app) {
if (isset(App::$nav_sel['name']) && App::$nav_sel['name'] == $app['name'])
$app['active'] = true;
-
if ($is_owner) {
$nav_apps[] = Apps::app_render($app, 'nav');
}
- elseif (!$is_owner && isset($app['requires']) && strpos($app['requires'], 'local_channel') === false) {
+ elseif (!$is_owner && (!isset($app['requires']) || (isset($app['requires']) && strpos($app['requires'], 'local_channel') === false))) {
$nav_apps[] = Apps::app_render($app, 'nav');
}
}
@@ -400,9 +399,9 @@ function channel_apps($is_owner = false, $nickname = null) {
$sql_options = item_permissions_sql($uid);
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
- where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s'
- and item.item_delayed = 0 and item.item_deleted = 0
- and ( iconfig.k = 'WEBPAGE' and item_type = %d )
+ where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s'
+ and item.item_delayed = 0 and item.item_deleted = 0
+ and ( iconfig.k = 'WEBPAGE' and item_type = %d )
$sql_options limit 1",
intval($uid),
dbesc('home'),