Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add HTML to product review?


MichelleDW

Recommended Posts

Obviously I don't want customers to be able to put malicious things or pron links into reviews, so I'm good with the general html stripping on the customer side. But I'd like to be able to add some html via to reviews via the admin panel (so I can put links to reviews on other sites). Is there a way to do this?

Link to comment
Share on other sites

  • 10 months later...

Obviously I don't want customers to be able to put malicious things or pron links into reviews, so I'm good with the general html stripping on the customer side. But I'd like to be able to add some html via to reviews via the admin panel (so I can put links to reviews on other sites). Is there a way to do this?

 

Even I'm trying to do the same......... But clueless......... :(

A man is great by Deeds, not by Birth....

Link to comment
Share on other sites

You want random customers to be able to add HTML, but need to block harmful stuff like <script> and <iframe>? That's a pretty tall order. If you google around, I'm sure you can find some PHP modules that will look for any HTML tag not in a whitelist and remove it. The PHP strip_tags function (http://us1.php.net/manual/en/function.strip-tags.php) might be a good start. An alternative would be to find a "BBCode" module to drop in, to expand [ b ] to <b>, etc. If you can't find one, steal one out of forum or blog software, such as SMF's parse_bbc function (simplemachines.org). In that case, you want to make sure that you disable all HTML tags first, before expanding BBCode tags into HTML.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...