Skip to content

Commit d904212

Browse files
committed
Merge branch 'release-v0.13.5' into develop
2 parents d484a1c + 62e90ce commit d904212

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/views/context_menus/MessageContextMenu.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright 2015, 2016 OpenMarket Ltd
3+
Copyright 2018 New Vector Ltd
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -26,6 +27,7 @@ import Modal from 'matrix-react-sdk/lib/Modal';
2627
import Resend from "matrix-react-sdk/lib/Resend";
2728
import SettingsStore from "matrix-react-sdk/lib/settings/SettingsStore";
2829
import {makeEventPermalink} from 'matrix-react-sdk/lib/matrix-to';
30+
import { isUrlPermitted } from 'matrix-react-sdk/lib/HtmlUtils';
2931

3032
module.exports = React.createClass({
3133
displayName: 'MessageContextMenu',
@@ -291,13 +293,16 @@ module.exports = React.createClass({
291293
}
292294

293295
// Bridges can provide a 'external_url' to link back to the source.
294-
if (typeof(this.props.mxEvent.event.content.external_url) === "string") {
296+
if (
297+
typeof(this.props.mxEvent.event.content.external_url) === "string" &&
298+
isUrlPermitted(this.props.mxEvent.event.content.external_url)
299+
) {
295300
externalURLButton = (
296301
<div className="mx_MessageContextMenu_field">
297302
<a href={this.props.mxEvent.event.content.external_url}
298-
rel="noopener" target="_blank" onClick={this.closeMenu}>{ _t('Source URL') }</a>
303+
rel="noopener" target="_blank" onClick={this.closeMenu}>{ _t('Source URL') }</a>
299304
</div>
300-
);
305+
);
301306
}
302307

303308

0 commit comments

Comments
 (0)