Add new allowed tags and new URI scheme

This commit is contained in:
Frederic Guillot 2013-07-26 21:16:19 -04:00
parent 0b5895733b
commit 7a091c314f

View File

@ -11,6 +11,7 @@ class Filter
private $strip_content = false; private $strip_content = false;
public $allowed_tags = array( public $allowed_tags = array(
'audio' => array('controls', 'src'),
'video' => array('poster', 'controls', 'height', 'width', 'src'), 'video' => array('poster', 'controls', 'height', 'width', 'src'),
'source' => array('src', 'type'), 'source' => array('src', 'type'),
'dt' => array(), 'dt' => array(),
@ -54,15 +55,41 @@ class Filter
'script' 'script'
); );
// http://en.wikipedia.org/wiki/URI_scheme
public $allowed_protocols = array( public $allowed_protocols = array(
'http://',
'https://',
'ftp://',
'mailto:',
'//', '//',
'data:image/png;base64,', 'data:image/png;base64,',
'data:image/gif;base64,', 'data:image/gif;base64,',
'data:image/jpg;base64,' 'data:image/jpg;base64,',
'bitcoin:',
'callto:',
'ed2k://',
'facetime://',
'feed:',
'ftp://',
'geo:',
'git://',
'http://',
'https://',
'irc://',
'irc6://',
'ircs://',
'jabber:',
'magnet:',
'mailto:',
'nntp://',
'rtmp://',
'sftp://',
'sip:',
'sips:',
'skype:',
'smb://',
'sms:',
'spotify:',
'ssh:',
'steam:',
'svn://',
'tel:',
); );
public $protocol_attributes = array( public $protocol_attributes = array(