В процессе допиливания магазина столкнулся с проблемой. атрибуты изображений получились вида
title="" class="browseProductImage" border="0" "=""
Долго мучился с исправлением, возможно исправил не совсем правильно, но другого решения не смог найти
Открываем файл /administrator/components/com_virtuemart/classes/htmlTools.class.php
и находим
function imageTag( $src, $alt='', $align='', $height='', $width='', $title='', $border='0', $attributes='' ) {
if( $align ) { $align = ' align="'.$align.'"'; }
if( $height ) { $height = ' height="'.$height.'"'; }
if( $width ) { $width = ' width="'.$width.'"'; }
if( $title ) { $title = ' title="'.$title.'"'; }
if( $attributes ) { $attributes = ' ' . $attributes; }
if( strpos($attributes, 'border=')===false) {
$border = ' border="'.$border.'"';
} // Prevent doubled attributes
if( strpos($attributes, 'alt=')===false) {
$alt = ' alt="'.$alt.'"';
}
return '<img src="'.$src.'"'.$alt.$align.$title.$height.$width.$border.$attributes.' />';
}
И меняем на
function imageTag( $src, $alt='', $align='', $height='', $width='', $title='' ) {
return '<img src="'.$src.'"'.$alt.$align.$title.$height.$width.$border.$attributes.' />';
}
Открываем /components/com_virtuemart/themes/default/templates/browse/browse_1.php
и этот код
<?php echo ps_product::image_tag( $product_thumb_image, 'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ) ?>
Меняем на
<?php echo ps_product::image_tag( $product_thumb_image, 'class="browseProductImage" border="0" title="'.htmlspecialchars($product_name).'" alt="'.htmlspecialchars($product_name) .'"' ) ?>
