Private
Public Access
fix: block javascript docset links
This commit is contained in:
1 parent
1d9456286f
commit
6bb1cf373d
2 files changed
+12
-2
No files matched your search
@@ -93,7 +93,12 @@ class DocsetRenderer
|
||||
if($value === '' || str_starts_with($value, '#'))
|
||||
return $value;
|
||||
$lower = strtolower($value);
|
||||
foreach(array('http://', 'https://', 'mailto:', 'data:', 'javascript:', 'about:') as $prefix)
|
||||
foreach(array('javascript:', 'vbscript:') as $prefix)
|
||||
{
|
||||
if(str_starts_with($lower, $prefix))
|
||||
return '#blocked-unsafe-url';
|
||||
}
|
||||
foreach(array('http://', 'https://', 'mailto:', 'data:', 'about:') as $prefix)
|
||||
{
|
||||
if(str_starts_with($lower, $prefix))
|
||||
return $value;
|
||||
|
||||
Reference in new issue
Block a user