The following code is for the built in Facebook sharer URL construction in Magento's 1.9 RWD theme.
<li>
<?php $_u = 'p[url]=' . $_productUrl . '&p[images][0]=' . $_productImageUrl . '&p[title]=' . $_productName . '&p[summary]=' . urlencode(trim($_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description'))); ?>
<a href="<?php echo 'http://www.facebook.com/sharer.php?s=100&' . $_u; ?>" target="_blank" title="<?php echo $this->__('Share on Facebook') ?>" class="link-facebook">
<?php echo $this->__('Share Facebook') ?>
</a>
</li>
When sharing a URL though with this Facebook button, the description for the page is including HTML tags. Not only have I tried to strip_tags
for the short description, it is actually using the long description even if I replace short description with another attribute. I can't find anything in Mage_Core for this...
It is changing the URL correctly for the &p[summary]=
parameter but when you preview the shared URL, it just shows the description along with HTML tags.
Any ideas on how to fix this?