improvement: encode query string value for validator badge url (#4724)

* Encode query string value for validator badge url

* add tests
This commit is contained in:
Yuanhai He
2018-07-14 02:44:10 +08:00
committed by kyle
parent 003d6b782d
commit e70a054bd4
2 changed files with 81 additions and 2 deletions

View File

@@ -54,8 +54,8 @@ export default class OnlineValidatorBadge extends React.Component {
}
return (<span style={{ float: "right"}}>
<a target="_blank" href={`${ sanitizedValidatorUrl }/debug?url=${ this.state.url }`}>
<ValidatorImage src={`${ sanitizedValidatorUrl }?url=${ this.state.url }`} alt="Online validator badge"/>
<a target="_blank" href={`${ sanitizedValidatorUrl }/debug?url=${ encodeURIComponent(this.state.url) }`}>
<ValidatorImage src={`${ sanitizedValidatorUrl }?url=${ encodeURIComponent(this.state.url) }`} alt="Online validator badge"/>
</a>
</span>)
}