fix: block javascript docset links

This commit is contained in:
udo committed 2026-06-30 00:54:18 +00:00
1 parent 1d9456286f
commit 6bb1cf373d
2 files changed
+12 -2

No files matched your search

+6 -1
View File
@@ -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;