fix(youtube): Incomplete URL substring sanitization
This commit is contained in:
@@ -19,7 +19,9 @@ export class YoutubeBlock extends BaseView {
|
|||||||
const tag_name = el.tagName;
|
const tag_name = el.tagName;
|
||||||
if (tag_name === 'A' && el.parentElement?.childElementCount === 1) {
|
if (tag_name === 'A' && el.parentElement?.childElementCount === 1) {
|
||||||
const href = el.getAttribute('href');
|
const href = el.getAttribute('href');
|
||||||
if (href.indexOf('.youtube.com') !== -1) {
|
const allowedHosts = ['.youtube.com'];
|
||||||
|
|
||||||
|
if (allowedHosts.includes(href)) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
type: this.type,
|
type: this.type,
|
||||||
|
|||||||
Reference in New Issue
Block a user