diff --git a/modules/filter.module b/modules/filter.module index dd33dbfc454859e41d1b01437c4d8a7841704b49..3d16de37cdcf9ff859d373faf00683074890333c 100644 --- a/modules/filter.module +++ b/modules/filter.module @@ -1239,7 +1239,10 @@ function filter_xss_bad_protocol($string, $decode = TRUE) { } function _filter_xss_bad_protocol($m) { - static $allowed_protocols = array('http' => TRUE, 'https' => TRUE, 'ftp' => TRUE, 'news' => TRUE, 'nntp' => TRUE, 'telnet' => TRUE, 'gopher' => TRUE, 'mailto' => TRUE, 'e2dk' => TRUE, 'smb' => TRUE, 'irc' => TRUE, 'rsync' => TRUE, 'ssh' => TRUE, 'sftp' => TRUE); + static $allowed_protocols; + if (!isset($allowed_protocols)) { + $allowed_protocols = array_flip(variable_get('filter_allowed_protocols', array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal'))); + } $string = preg_replace('/\s+/', '', $m[1]); return isset($allowed_protocols[$string]) ? "$string:" : ''; }