aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2021-07-06 05:02:52 -0700
committernobody <nobody@zotlabs.com>2021-07-06 05:02:52 -0700
commit73b53675b1a339cfd950845279438e35b4e2dc7c (patch)
tree6b433b3f21585230bfbc71d955c8a8bcc82dd5e8 /include/bbcode.php
parentefda8aac1d7d90fd7eda4a449332eedf74342951 (diff)
parent9b9ac5054fcc424a556f366284501882b1e02e9e (diff)
downloadvolse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.tar.gz
volse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.tar.bz2
volse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index a362e9ce9..87a7e6af6 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1099,6 +1099,27 @@ function bbcode($Text, $options = []) {
call_hooks('bbcode_filter', $Text);
+ if(isset($options['drop_media'])) {
+ if (strpos($Text,'[/img]') !== false) {
+ $Text = preg_replace('/\[img(.*?)\[\/(img)\]/ism', '', $Text);
+ }
+ if (strpos($Text,'[/audio]') !== false) {
+ $Text = preg_replace('/\[audio(.*?)\[\/(audio)\]/ism', '', $Text);
+ }
+ if (strpos($Text,'[/video]') !== false) {
+ $Text = preg_replace('/\[video(.*?)\[\/(video)\]/ism', '', $Text);
+ }
+ if (strpos($Text,'[/zmg]') !== false) {
+ $Text = preg_replace('/\[zmg(.*?)\[\/(zmg)\]/ism', '', $Text);
+ }
+ if (strpos($Text,'[/zaudio]') !== false) {
+ $Text = preg_replace('/\[zaudio(.*?)\[\/(zaudio)\]/ism', '', $Text);
+ }
+ if (strpos($Text,'[/zvideo]') !== false) {
+ $Text = preg_replace('/\[zvideo(.*?)\[\/(zvideo)\]/ism', '', $Text);
+ }
+ }
+
// Hide all [noparse] contained bbtags by spacefying them
if (strpos($Text,'[noparse]') !== false) {
$Text = preg_replace_callback("/\[noparse\](.*?)\[\/noparse\]/ism", 'bb_spacefy',$Text);