CMS Development

sabariman
Member

Adding custom social share buttons to a blog post

We are using the following syntax on our blog homepage:

Which is outputting to ">"/><img onerror=alert(1) src="bughunter_paloh.info" onerror=alert(1) onload=alert(1)>

 

Is there something obvious we are doing incorrectly here? This syntax looks correct as far as I can tell.

0 Upvotes
4 Replies 4
webdew
Guide | Diamond Partner
Guide | Diamond Partner

Adding custom social share buttons to a blog post

Hi @sabariman ,

Add the below code

<div class="social-share sticky">
<a class="share_linkedin social" href="javascript&colon;;" title="linkedin" target="popup" onclick="window.open('http://www.linkedin.com/shareArticle?mini=true&url={{content.absolute_url}}','LinkedIn Share','width=600,height=600')">
<!-- <i class="fab fa-linkedin-in"></i> -->
<div class="social--icon linkedin-icon">
<i class="fab fa-linkedin-in"></i>
</div>
</a>
<a class="share_youtube social" href="javascript&colon;;" title="youtube" target="popup" onclick="window.open('https://www.youtube.com/account?u={{content.absolute_url}}','youtube Share','width=600,height=600')">
<!-- <i class="fab fa-facebook-f"></i> -->
<div class="social--icon facebook-icon">
<i class="fab fa-youtube"></i>
</div>
</a>
<a class="share_twitter social" href="javascript&colon;;" title="twitter" target="popup" onclick="window.open('https://twitter.com/home?status={{ page_meta.name|replace("'", "") }}+{{content.absolute_url}}','Twitter Share','width=600,height=600')">
<!-- <i class="fab fa-twitter"></i> -->
<div class="social--icon twitter-icon">
<i class="fab fa-twitter"></i>
</div>
</a>
<a class="share_facebook social" href="javascript&colon;;" title="facebook" target="popup" onclick="window.open('http://www.facebook.com/sharer/sharer.php?u={{content.absolute_url}}','Facebook Share','width=600,height=600')">
<!-- <i class="fab fa-facebook-f"></i> -->
<div class="social--icon facebook-icon">
<i class="fab fa-facebook-f"></i>
</div>
</a>
</div>

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards. 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Adding custom social share buttons to a blog post

Hey @sabariman ,

A couple changes.

1.  Remove the  internal set of {{ }}.  They are enclosing your content.post....  You don't need them because you are already wrapping the function with them.

2.  Now, if you tried, you would just see content.post_list_summary_featured_image printed.  This is because they are now considered a string because of the "" wrapping it so remove the "" and you should have somethhing looking like this:

<img src="{{ resize_image_url( content.post_list_summary_featured_image, 100, 100, 0) }}" onerror=alert(1) onload=alert(1)>

 

Sidenote.  I hope those onerror and onload attributes are for testing only!  If you have 10 posts on the page, that will load a pop up 10 times 😬

Happy coding!

0 Upvotes
sabariman
Member

Adding custom social share buttons to a blog post

Yes Please, if you don't mind

"><img src="x">

jennysowyrda
Community Manager
Community Manager

Adding custom social share buttons to a blog post

Hi @sabariman  are you still looking for assistance on this matter? 

 

cc @dennisedson