@@ -2,6 +2,7 @@ import React from "react"
22import PropTypes from "prop-types"
33import { fromJS } from "immutable"
44import ImPropTypes from "react-immutable-proptypes"
5+ import { sanitizeUrl } from "core/utils"
56
67
78class Path extends React . Component {
@@ -35,9 +36,9 @@ class Contact extends React.Component {
3536
3637 return (
3738 < div >
38- { url && < div > < a href = { url } target = "_blank" > { name } - Website</ a > </ div > }
39+ { url && < div > < a href = { sanitizeUrl ( url ) } target = "_blank" > { name } - Website</ a > </ div > }
3940 { email &&
40- < a href = { `mailto:${ email } ` } >
41+ < a href = { sanitizeUrl ( `mailto:${ email } ` ) } >
4142 { url ? `Send email to ${ name } ` : `Contact ${ name } ` }
4243 </ a >
4344 }
@@ -59,7 +60,7 @@ class License extends React.Component {
5960 return (
6061 < div >
6162 {
62- url ? < a target = "_blank" href = { url } > { name } </ a >
63+ url ? < a target = "_blank" href = { sanitizeUrl ( url ) } > { name } </ a >
6364 : < span > { name } </ span >
6465 }
6566 </ div >
@@ -97,7 +98,7 @@ export default class Info extends React.Component {
9798 { version && < VersionStamp version = { version } > </ VersionStamp > }
9899 </ h2 >
99100 { host || basePath ? < Path host = { host } basePath = { basePath } /> : null }
100- { url && < a target = "_blank" href = { url } > < span className = "url" > { url } </ span > </ a > }
101+ { url && < a target = "_blank" href = { sanitizeUrl ( url ) } > < span className = "url" > { url } </ span > </ a > }
101102 </ hgroup >
102103
103104 < div className = "description" >
@@ -106,14 +107,14 @@ export default class Info extends React.Component {
106107
107108 {
108109 termsOfService && < div >
109- < a target = "_blank" href = { termsOfService } > Terms of service</ a >
110+ < a target = "_blank" href = { sanitizeUrl ( termsOfService ) } > Terms of service</ a >
110111 </ div >
111112 }
112113
113114 { contact && contact . size ? < Contact data = { contact } /> : null }
114115 { license && license . size ? < License license = { license } /> : null }
115116 { externalDocsUrl ?
116- < a target = "_blank" href = { externalDocsUrl } > { externalDocsDescription || externalDocsUrl } </ a >
117+ < a target = "_blank" href = { sanitizeUrl ( externalDocsUrl ) } > { externalDocsDescription || externalDocsUrl } </ a >
117118 : null }
118119
119120 </ div >
0 commit comments