Skip to content

Commit

Permalink
Merge pull request #334 from KeitIG/hotfix-cover-path-with-quotes
Browse files Browse the repository at this point in the history
Fix cover fetch when it has single or doublequotes in its path
  • Loading branch information
Pierre de la Martinière authored Apr 1, 2017
2 parents c1ad87e + d6f1372 commit 7922cfa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/components/Shared/Cover.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export default class TrackCover extends PureComponent {

render() {
if(this.state.coverPath) {
const styles = { backgroundImage: `url('${this.state.coverPath}')` };
const coverPath = encodeURI(this.state.coverPath)
.replace(/'/g, '\\\'')
.replace(/"/g, '\\"');
const styles = { backgroundImage: `url('${coverPath}')` };

return <div className='cover' style={ styles } />;
}
Expand Down

0 comments on commit 7922cfa

Please sign in to comment.