MDL-46286 lib_htmlpurifier: Add allowed URI scheme for RTMP

Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
This commit is contained in:
Tony Butler 2014-07-07 17:21:08 +01:00
parent 5fd0df97c5
commit 817b202018
3 changed files with 20 additions and 0 deletions

View File

@ -41,6 +41,22 @@ class HTMLPurifier_URIScheme_rtsp extends HTMLPurifier_URIScheme {
}
/**
* Validates RTMP defined by Adobe
*/
class HTMLPurifier_URIScheme_rtmp extends HTMLPurifier_URIScheme {
public $browsable = false;
public $hierarchical = true;
public function doValidate(&$uri, $config, $context) {
$uri->userinfo = null;
return true;
}
}
/**
* Validates IRC defined by IETF Draft
*/

View File

@ -295,6 +295,9 @@ class core_htmlpurifier_testcase extends basic_testcase {
$text = '<a href="rtsp://www.example.com/movie.mov">link</a>';
$this->assertSame($text, purify_html($text));
$text = '<a href="rtmp://www.example.com/video.f4v">link</a>';
$this->assertSame($text, purify_html($text));
$text = '<a href="teamspeak://speak.example.com/?par=val?par2=val2">link</a>';
$this->assertSame($text, purify_html($text));

View File

@ -1680,6 +1680,7 @@ function purify_html($text, $options = array()) {
'nntp' => true,
'news' => true,
'rtsp' => true,
'rtmp' => true,
'teamspeak' => true,
'gopher' => true,
'mms' => true,