From 96aadb23f8beb2b0ae453d9f4ba6bf9fc86ba1cd Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Tue, 31 Jan 2017 03:44:32 +0000 Subject: [PATCH] Change $allowed_src_protocols to static --- include/bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/bbcode.php b/include/bbcode.php index 0f1a705faa..489ef8b2e3 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1164,7 +1164,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal $Text = preg_replace('/\<([^>]*?)(src|href)=(.*?)\&\;(.*?)\>/ism', '<$1$2=$3&$4>', $Text); // sanitizes src attributes (http and redir URLs for displaying in a web page, cid used for inline images in emails) - $allowed_src_protocols = array('http', 'redir', 'cid'); + static $allowed_src_protocols = array('http', 'redir', 'cid'); $Text = preg_replace('#<([^>]*?)(src)="(?!' . implode('|', $allowed_src_protocols) . ')(.*?)"(.*?)>#ism', '<$1$2=""$4 class="invalid-src" title="' . t('Invalid source protocol') . '">', $Text);