Hello,
on a 3.2.14 (upgrading from 3.2.4) when i have < in shipping mode ( france < 3kg ) items does not display in pdf , either note as invoice.
Hello
Haven´t seen this before, where exactly do You have the text ? I tried in Name and description and it works as expected. Tested on 3.2.12 and 3.2.15. Does this only happen in pdf ?.
Have You tried with < ?
Jörgen
so,
I see what is happening
It is insered in field shipment_name in table Shipment Weight Countries.
The code insered in this field is : <span class="vmshipment_name">FRANCE < 3 Kg</span><span class="vmshipment_description">Envoi en France métropolitaine jusqu'à 3Kg</span>
I see the problem, and if i clean that field for each entry it works, but I do not find what is the file who generate this and include it in the database.
Perharps it is a change made by the previous webmaster ...
Do you know how I will be able to find this file ?
Thanks
administrator\components\com_virtuemart\plugins\vmpsplugin.php
protected function renderPluginName ($plugin)
you can over ride this function in any plugin
Ok, i see it :
protected function renderPluginName ($plugin) {
static $c = array();
$idN = 'virtuemart_'.$this->_psType.'method_id';
if(isset($c[$this->_psType][$plugin->$idN])){
return $c[$this->_psType][$plugin->$idN];
}
$return = '';
$plugin_name = $this->_psType . '_name';
$plugin_desc = $this->_psType . '_desc';
$description = '';
$logosFieldName = $this->_psType . '_logos';
$logos = property_exists($plugin,$logosFieldName)? $plugin->$logosFieldName:array();
if (!empty($logos)) {
$return = $this->displayLogos ($logos) . ' ';
}
if (!empty($plugin->$plugin_desc)) {
$description = '<span class="' . $this->_type . '_description">' . $plugin->$plugin_desc . '</span>';
}
$c[$this->_psType][$plugin->$idN] = $return . '<span class="' . $this->_type . '_name">' . $plugin->$plugin_name . '</span>' . $description;
return $c[$this->_psType][$plugin->$idN];
}
How can I do to not have < working has html element ?
should I report this as a bug that should impact others sites ? or Is this just my site ??
thanks
Quote from: serge-web54 on September 23, 2018, 20:03:03 PM
( france < 3kg )
What happens if that is entered as ( france < 3kg ) ?
yes it works when entering that.
I have to change all my shipments in database.
I think this behaviour is not normal
you need to use php 'htmlentities' function . See below modified code for the same.
protected function renderPluginName ($plugin) {
static $c = array();
$idN = 'virtuemart_'.$this->_psType.'method_id';
if(isset($c[$this->_psType][$plugin->$idN])){
return $c[$this->_psType][$plugin->$idN];
}
$return = '';
$plugin_name = $this->_psType . '_name';
$plugin_desc = $this->_psType . '_desc';
$description = '';
$logosFieldName = $this->_psType . '_logos';
$logos = property_exists($plugin,$logosFieldName)? $plugin->$logosFieldName:array();
if (!empty($logos)) {
$return = $this->displayLogos ($logos) . ' ';
}
if (!empty($plugin->$plugin_desc)) {
$description = '<span class="' . $this->_type . '_description">' . htmlentities($plugin->$plugin_desc ). '</span>';
}
$c[$this->_psType][$plugin->$idN] = $return . '<span class="' . $this->_type . '_name">' . htmlentities($plugin->$plugin_name) . '</span>' . $description;
return $c[$this->_psType][$plugin->$idN];
}
Thanks
Kishore