Skip to content

Commit

Permalink
fix: encode share url (#600)
Browse files Browse the repository at this point in the history
use encodeURIComponent on the share url
  • Loading branch information
yairans committed May 9, 2021
1 parent 955bcac commit c8a4bfe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/share-overlay/share-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ const ShareButton = (props: Object): React$Element<any> => {
const templateUrl = props.config.templateUrl;
let href = shareUrl;
if (templateUrl) {
href = templateUrl.replace('{shareUrl}', shareUrl);
try {
href = templateUrl.replace('{shareUrl}', encodeURIComponent(shareUrl));
} catch (e) {
href = templateUrl.replace('{shareUrl}', shareUrl);
}
}
window.open(href, '_blank', 'width=580,height=580');
};
Expand Down

0 comments on commit c8a4bfe

Please sign in to comment.