allow inline svgs to federate as data urls

This commit is contained in:
zotlabs 2020-01-14 21:48:28 -08:00
parent 2695bded8f
commit 7a8f9670c0

View file

@ -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);