diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-06-23 21:15:26 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-06-23 21:15:26 +0200 |
commit | dfcd8395d5aff83b8d6e1fa83346f0f0bd78f879 (patch) | |
tree | 5fb84907619bdc02c7434dcf6318bbbae5786dfe /include/bbcode.php | |
parent | cf791a19099e0e4a8a0679e720a4f99755083cca (diff) | |
parent | 6e91bee0ba605b938bddf0570e747d6d7be1c712 (diff) | |
download | volse-hubzilla-dfcd8395d5aff83b8d6e1fa83346f0f0bd78f879.tar.gz volse-hubzilla-dfcd8395d5aff83b8d6e1fa83346f0f0bd78f879.tar.bz2 volse-hubzilla-dfcd8395d5aff83b8d6e1fa83346f0f0bd78f879.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 21 |
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); |