mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-46286 lib_htmlpurifier: Add allowed URI scheme for RTMP
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
This commit is contained in:
parent
5fd0df97c5
commit
817b202018
@ -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
|
||||
*/
|
||||
|
@ -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));
|
||||
|
||||
|
@ -1680,6 +1680,7 @@ function purify_html($text, $options = array()) {
|
||||
'nntp' => true,
|
||||
'news' => true,
|
||||
'rtsp' => true,
|
||||
'rtmp' => true,
|
||||
'teamspeak' => true,
|
||||
'gopher' => true,
|
||||
'mms' => true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user