mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 03:55:18 +00:00
allow inline svgs to federate as data urls
This commit is contained in:
parent
2695bded8f
commit
7a8f9670c0
1 changed files with 8 additions and 1 deletions
|
@ -1650,8 +1650,15 @@ function bbcode($Text, $options = []) {
|
|||
|
||||
// This is subtle - it's an XSS filter. It only accepts links with a protocol scheme and where
|
||||
// the scheme begins with z (zhttp), h (http(s)), f (ftp(s)), m (mailto), t (tel) and named anchors.
|
||||
// data: urls are allowed if exporting to activitypub which allows inline svg to federate, but not
|
||||
// to be used for local display
|
||||
|
||||
$Text = preg_replace("/\<(.*?)(src|href)=\"[^zhfmt#](.*?)\>/ism", '<$1$2="">', $Text);
|
||||
if ($activitypub) {
|
||||
$Text = preg_replace("/\<(.*?)(src|href)=\"[^dzhfmt#](.*?)\>/ism", '<$1$2="">', $Text);
|
||||
}
|
||||
else {
|
||||
$Text = preg_replace("/\<(.*?)(src|href)=\"[^zhfmt#](.*?)\>/ism", '<$1$2="">', $Text);
|
||||
}
|
||||
|
||||
$Text = bb_replace_images($Text, $saved_images);
|
||||
|
||||
|
|
Loading…
Reference in a new issue