Sanitize translated HTML

This commit is contained in:
Kegan Dougal 2017-05-31 16:38:51 +01:00
parent 1dce9cda9e
commit a3ebeb5c69
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@ limitations under the License.
*/ */
var React = require("react"); var React = require("react");
var sanitizeHtml = require("sanitize-html");
import { _t } from 'matrix-react-sdk/lib/languageHandler'; import { _t } from 'matrix-react-sdk/lib/languageHandler';
module.exports = React.createClass({ module.exports = React.createClass({
@ -30,7 +31,7 @@ module.exports = React.createClass({
{ _t('Custom Server Options') } { _t('Custom Server Options') }
</div> </div>
<div className="mx_Dialog_content"> <div className="mx_Dialog_content">
<span dangerouslySetInnerHTML={{__html: _t('customServer_text')}} /> <span dangerouslySetInnerHTML={{__html: sanitizeHtml(_t('customServer_text'))}} />
</div> </div>
<div className="mx_Dialog_buttons"> <div className="mx_Dialog_buttons">
<button onClick={this.props.onFinished} autoFocus={true}> <button onClick={this.props.onFinished} autoFocus={true}>