Author Topic: Bug in shop.product_description  (Read 1919 times)

doorknob

  • Jr. Member
  • **
  • Posts: 151
Bug in shop.product_description
« on: July 15, 2008, 00:01:25 am »
As with shop.browse, allowing ampersands into the description meta tag causes a potential compliance issue. This can be fixed by changing

Code: [Select]
// Prepend Product Short Description Meta Tag "description"
if( vmIsJoomla('1.5')) {
$document = JFactory::getDocument();
$document->setDescription( strip_tags( $db_product->f("product_s_desc")));
} else {
$mainframe->prependMetaTag( "description", strip_tags( $db_product->f("product_s_desc")));
}
to
Code: [Select]
// Prepend Product Short Description Meta Tag "description"
$meta_desc = substr( str_replace(array('&','&'), 'and', strip_tags( $db_product->f('product_s_desc') )), 0, 255);
if( vmIsJoomla('1.5') ) {
$document =& JFactory::getDocument();
$document->setDescription( $meta_desc );
} else {
$mainframe->prependMetaTag( 'description', $meta_desc );
}
Regards
Phil