Merge "renderer.article: Ignore thumnail if the URL has suspicious characters"

This commit is contained in:
jenkins-bot 2015-03-26 10:33:42 +00:00 committed by Gerrit Code Review
commit 7d21948d1a

View file

@ -249,11 +249,18 @@
var svg = mw.popups.supportsSVG;
if (
!thumbnail || // No thumbnail
// No thumbnail
!thumbnail ||
// Image too small for landscape display
( !tall && thumbnail.width < article.SIZES.landscapeImage.w ) ||
// Image too small for protrait display
( tall && thumbnail.height < article.SIZES.portraitImage.h )
( tall && thumbnail.height < article.SIZES.portraitImage.h ) ||
// These characters in URL that could inject CSS and thus JS
(
thumbnail.source.indexOf( '\\' ) > -1 ||
thumbnail.source.indexOf( '\'' ) > -1 ||
thumbnail.source.indexOf( '\"' ) > -1
)
) {
return $( '<span>' );
}