Browse Source

Fix XSS with iframe url starts with spaces

pull/6/head
Menci 7 years ago
parent
commit
b5fc7b92b9
  1. 4
      utility.js

4
utility.js

@ -100,11 +100,11 @@ module.exports = {
$(elem).attr('style', cssfilter.process($(elem).attr('style'))); $(elem).attr('style', cssfilter.process($(elem).attr('style')));
} }
if ($(elem).attr('href') && $(elem).attr('href').startsWith('javascript:')) { if ($(elem).attr('href') && $(elem).attr('href').trim().toLowerCase().startsWith('javascript:')) {
$(elem).attr('href', ''); $(elem).attr('href', '');
} }
if ($(elem).attr('src') && $(elem).attr('src').startsWith('javascript:')) { if ($(elem).attr('src') && $(elem).attr('src').trim().toLowerCase().startsWith('javascript:')) {
$(elem).attr('src', ''); $(elem).attr('src', '');
} }
}); });

Loading…
Cancel
Save