Skip to content

Commit

Permalink
Merge pull request #9 from stillwaiting/encodeURIComponent
Browse files Browse the repository at this point in the history
Use encodeURIComponents when building share urls
  • Loading branch information
ozdemirburak authored Oct 4, 2016
2 parents fed3631 + a95d908 commit c1d1848
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.floating-social-share.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/jquery.floating-social-share.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
$.each(networks, function(k, v) {
if (value === k) {
var $icon = $("<i>", { class: "margin-top-5 fa fa-" + value }),
_href = v.url.replace('{url}', base.settings.url)
.replace('{title}', base.settings.title)
.replace('{description}', base.settings.description)
.replace('{media}', base.settings.media),
_href = v.url.replace('{url}', encodeURIComponent(base.settings.url))
.replace('{title}', encodeURIComponent(base.settings.title))
.replace('{description}', encodeURIComponent(base.settings.description))
.replace('{media}', encodeURIComponent(base.settings.media)),
$component = $("<a>", { title: base.settings.title, class: v.className + " pop-upper"}).attr("href", _href).attr("title", base.settings.text + value).append($icon);
if (base.settings.counter === true) {
setShareCount(value, encodeURI(base.settings.url), $component, base.settings.twitter_counter);
Expand Down

0 comments on commit c1d1848

Please sign in to comment.