File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11/*
22Copyright 2015, 2016 OpenMarket Ltd
3+ Copyright 2018 New Vector Ltd
34
45Licensed under the Apache License, Version 2.0 (the "License");
56you may not use this file except in compliance with the License.
@@ -26,6 +27,7 @@ import Modal from 'matrix-react-sdk/lib/Modal';
2627import Resend from "matrix-react-sdk/lib/Resend" ;
2728import SettingsStore from "matrix-react-sdk/lib/settings/SettingsStore" ;
2829import { makeEventPermalink } from 'matrix-react-sdk/lib/matrix-to' ;
30+ import { isUrlPermitted } from 'matrix-react-sdk/lib/HtmlUtils' ;
2931
3032module . 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
You can’t perform that action at this time.
0 commit comments