SECURITY: ve.ui.MWMediaDialog: Escape plaintext image metadata fields

CVE-2021-44855

Bug: T293589
Change-Id: I691b4065e67c53c4276599c8d16c31ab5591db3a
This commit is contained in:
sbassett 2021-11-16 12:17:18 -06:00 committed by Reedy
parent 5f4d43c0c6
commit 61d9bb77b5

View file

@ -780,9 +780,9 @@ ve.ui.MWMediaDialog.prototype.cleanAPIresponse = function ( rawResponse, config
}
// Check if the string should be truncated
return isTruncated && !config.ignoreCharLimit ?
originalText.substring( 0, charLimit ) + ellipsis :
originalText;
return mw.html.escape( isTruncated && !config.ignoreCharLimit ?
originalText.slice( 0, charLimit ) + ellipsis :
originalText );
};
/**