Fix html content

This commit is contained in:
Laurent Destailleur 2021-11-22 12:37:47 +01:00
parent 3dbab22060
commit 60ef230447
2 changed files with 18 additions and 8 deletions

View File

@ -284,7 +284,8 @@ class Dolistore
$download_link .= '<br><br><a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>'; $download_link .= '<br><br><a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} }
//checking versions // Set and check version
$version = '';
if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
//compatible //compatible
@ -319,14 +320,21 @@ class Dolistore
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a> //.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template //output template
$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'"> $html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">';
<td class="center" width="210"><div class="newAppParent">'.dol_escape_htmltag($newapp.$images).'</div></td> $html .= '<td class="center" width="210"><div class="newAppParent">';
<td class="margeCote"><h2 class="appTitle">'.dol_escape_htmltag($product->name->language[$this->lang - 1]) $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html
.'<br><small>'.dol_escape_htmltag($version).'</small></h2> $html .= '</div></td>';
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>'; $html .= '<td class="margeCote"><h2 class="appTitle">';
$html .= dol_escape_htmltag($product->name->language[$this->lang - 1]);
$html .= '<br><small>';
$html .= $version; // No dol_escape_htmltag, it is already escape html
$html .= '</small></h2>';
$html .= '<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
// do not load if display none // do not load if display none
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>'; //$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
$html .= '<td class="margeCote center">'.dol_escape_htmltag($price).'</td>'; $html .= '<td class="margeCote center">';
$html .= $price;
$html .= '</td>';
$html .= '<td class="margeCote">'.$download_link.'</td>'; $html .= '<td class="margeCote">'.$download_link.'</td>';
$html .= '</tr>'; $html .= '</tr>';
} }

View File

@ -1051,7 +1051,9 @@ if ($mode == 'marketplace') {
<div id="category-tree-left"> <div id="category-tree-left">
<ul class="tree"> <ul class="tree">
<?php echo dol_escape_htmltag($dolistore->get_categories()); ?> <?php
echo $dolistore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content
?>
</ul> </ul>
</div> </div>
<div id="listing-content"> <div id="listing-content">