+
trans('SendNewPasswordDesc'); ?>
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 344c65832db..c01c720f481 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -1084,7 +1084,7 @@ if (empty($reshook)) {
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat', 'int');
- $qty = GETPOST('qty', 'int');
+ $qty = price2num(GETPOST('qty', 'alpha'));
if (empty($qty)) {
$qty = 1;
}
@@ -1101,21 +1101,21 @@ if (empty($reshook)) {
$action = '';
}
- // Si aucune date n'est rentrée
+ // If no date entered
if (empty($date) || $date == "--") {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
+ } elseif ($date < $object->date_debut || $date > ($object->date_fin + (24 * 3600 - 1))) {
+ // Warning if date out of range
+ $langs->load("errors");
+ setEventMessages($langs->trans("WarningDateOfLineMustBeInExpenseReportRange"), null, 'warnings');
}
- // Si aucun prix n'est rentré
+
+ // If no price entered
if ($value_unit == 0) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PriceUTTC")), null, 'errors');
}
- // Warning if date out of range
- if ($date < $object->date_debut || $date > ($object->date_fin + (24 * 3600 - 1))) {
- $langs->load("errors");
- setEventMessages($langs->trans("WarningDateOfLineMustBeInExpenseReportRange"), null, 'warnings');
- }
if (!$error) {
$type = 0; // TODO What if service ? We should take the type product/service from the type of expense report llx_c_type_fees
@@ -1215,12 +1215,12 @@ if (empty($reshook)) {
}
}
- $rowid = $_POST['rowid'];
+ $rowid = GETPOST('rowid', 'int');
$type_fees_id = GETPOST('fk_c_type_fees', 'int');
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat', 'int');
$projet_id = $fk_project;
$comments = GETPOST('comments', 'restricthtml');
- $qty = GETPOST('qty', 'int');
+ $qty = price2num(GETPOST('qty', 'alpha'));
$vatrate = GETPOST('vatrate', 'alpha');
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
@@ -2474,32 +2474,32 @@ if ($action == 'create') {
print '';
} // Fin si c'est payé/validé
- print '';
- print '
';
+ print '';
+ print '
';
- print '';
+ ';
- print '';
+ print '';
- print dol_get_fiche_end();
+ print dol_get_fiche_end();
}
} else {
dol_print_error($db);
@@ -2511,9 +2511,11 @@ if ($action == 'create') {
exit(1);
}
+
/*
* Action bar
*/
+
print '
';
if ($action != 'create' && $action != 'edit') {
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index 9592f9548af..b3601c00deb 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -2119,7 +2119,7 @@ class ExpenseReport extends CommonObject
$this->line->fk_ecm_files = $fk_ecm_files;
- $this->line->id = $rowid;
+ $this->line->id = ((int) $rowid);
// Select des infos sur le type fees
$sql = "SELECT c.code as code_type_fees, c.label as libelle_type_fees";
@@ -2703,10 +2703,10 @@ class ExpenseReportLine
$sql .= " '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."',";
$sql .= " '".$this->db->escape($this->comments)."',";
$sql .= " ".((float) $this->qty).",";
- $sql .= " ".((int) $this->value_unit).",";
- $sql .= " ".price2num($this->total_ht).",";
- $sql .= " ".price2num($this->total_tva).",";
- $sql .= " ".price2num($this->total_ttc).",";
+ $sql .= " ".((float) $this->value_unit).",";
+ $sql .= " ".((float) price2num($this->total_ht)).",";
+ $sql .= " ".((float) price2num($this->total_tva)).",";
+ $sql .= " ".((float) price2num($this->total_ttc)).",";
$sql .= " '".$this->db->idate($this->date)."',";
$sql .= " ".(empty($this->rule_warning_message) ? 'null' : "'".$this->db->escape($this->rule_warning_message)."'").",";
$sql .= " ".((int) $this->fk_c_exp_tax_cat).",";
@@ -2811,26 +2811,26 @@ class ExpenseReportLine
// Update line in database
$sql = "UPDATE ".MAIN_DB_PREFIX."expensereport_det SET";
$sql .= " comments='".$this->db->escape($this->comments)."'";
- $sql .= ",value_unit = ".((float) $this->value_unit);
- $sql .= ",qty=".((float) $this->qty);
- $sql .= ",date='".$this->db->idate($this->date)."'";
- $sql .= ",total_ht=".((float) price2num($this->total_ht, 'MT'))."";
- $sql .= ",total_tva=".((float) price2num($this->total_tva, 'MT'))."";
- $sql .= ",total_ttc=".((float) price2num($this->total_ttc, 'MT'))."";
- $sql .= ",tva_tx=".((float) $this->vatrate);
- $sql .= ",vat_src_code='".$this->db->escape($this->vat_src_code)."'";
- $sql .= ",rule_warning_message='".$this->db->escape($this->rule_warning_message)."'";
- $sql .= ",fk_c_exp_tax_cat=".$this->db->escape($this->fk_c_exp_tax_cat);
- $sql .= ",fk_ecm_files=".($this->fk_ecm_files > 0 ? ((int) $this->fk_ecm_files) : 'null');
+ $sql .= ", value_unit = ".((float) $this->value_unit);
+ $sql .= ", qty=".((float) $this->qty);
+ $sql .= ", date='".$this->db->idate($this->date)."'";
+ $sql .= ", total_ht=".((float) price2num($this->total_ht, 'MT'))."";
+ $sql .= ", total_tva=".((float) price2num($this->total_tva, 'MT'))."";
+ $sql .= ", total_ttc=".((float) price2num($this->total_ttc, 'MT'))."";
+ $sql .= ", tva_tx=".((float) $this->vatrate);
+ $sql .= ", vat_src_code='".$this->db->escape($this->vat_src_code)."'";
+ $sql .= ", rule_warning_message='".$this->db->escape($this->rule_warning_message)."'";
+ $sql .= ", fk_c_exp_tax_cat=".$this->db->escape($this->fk_c_exp_tax_cat);
+ $sql .= ", fk_ecm_files=".($this->fk_ecm_files > 0 ? ((int) $this->fk_ecm_files) : 'null');
if ($this->fk_c_type_fees) {
- $sql .= ",fk_c_type_fees = ".((int) $this->fk_c_type_fees);
+ $sql .= ", fk_c_type_fees = ".((int) $this->fk_c_type_fees);
} else {
- $sql .= ",fk_c_type_fees=null";
+ $sql .= ", fk_c_type_fees=null";
}
if ($this->fk_project > 0) {
- $sql .= ",fk_projet=".((int) $this->fk_project);
+ $sql .= ", fk_projet=".((int) $this->fk_project);
} else {
- $sql .= ",fk_projet=null";
+ $sql .= ", fk_projet=null";
}
$sql .= " WHERE rowid = ".((int) ($this->rowid ? $this->rowid : $this->id));
diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
index 42be03263a8..9264400a71f 100644
--- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
+++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
@@ -72,7 +72,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) {
}
// If the preview file is found
if (file_exists($fileimage)) {
- $thumbshown = '
.')
';
+ $thumbshown = '
.'&file='.urlencode($relativepathimage).')
';
}
}
}
diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php
index 91fec8d998e..d4a21a22314 100644
--- a/htdocs/includes/odtphp/odf.php
+++ b/htdocs/includes/odtphp/odf.php
@@ -65,12 +65,12 @@ class Odf
}
$md5uniqid = md5(uniqid());
- if ($this->config['PATH_TO_TMP']) $this->tmpdir = preg_replace('|[\/]$|','',$this->config['PATH_TO_TMP']); // Remove last \ or /
+ if ($this->config['PATH_TO_TMP']) $this->tmpdir = preg_replace('|[\/]$|', '', $this->config['PATH_TO_TMP']); // Remove last \ or /
$this->tmpdir .= ($this->tmpdir?'/':'').$md5uniqid;
$this->tmpfile = $this->tmpdir.'/'.$md5uniqid.'.odt'; // We keep .odt extension to allow OpenOffice usage during debug.
// A working directory is required for some zip proxy like PclZipProxy
- if (in_array($this->config['ZIP_PROXY'],array('PclZipProxy')) && ! is_dir($this->config['PATH_TO_TMP'])) {
+ if (in_array($this->config['ZIP_PROXY'], array('PclZipProxy')) && ! is_dir($this->config['PATH_TO_TMP'])) {
throw new OdfException('Temporary directory '.$this->config['PATH_TO_TMP'].' must exists');
}
@@ -81,8 +81,8 @@ class Odf
// Load zip proxy
$zipHandler = $this->config['ZIP_PROXY'];
- if (!defined('PCLZIP_TEMPORARY_DIR')) define('PCLZIP_TEMPORARY_DIR',$this->tmpdir);
- include_once('zip/'.$zipHandler.'.php');
+ if (!defined('PCLZIP_TEMPORARY_DIR')) define('PCLZIP_TEMPORARY_DIR', $this->tmpdir);
+ include_once 'zip/'.$zipHandler.'.php';
if (! class_exists($this->config['ZIP_PROXY'])) {
throw new OdfException($this->config['ZIP_PROXY'] . ' class not found - check your php settings');
}
@@ -147,13 +147,13 @@ class Odf
}
/**
- * Replaces html tags in odt tags and returns a compatible string
- * @param string $key Name of the variable within the template
+ * Replaces html tags in odt tags and returns a compatible string
+ * @param string $key Name of the variable within the template
* @param string $value Replacement value
* @param bool $encode If true, special XML characters are encoded
* @param string $charset Charset
- * @return string
- */
+ * @return string
+ */
public function convertVarToOdf($value, $encode = true, $charset = 'ISO-8859')
{
$value = $encode ? htmlspecialchars($value) : $value;
@@ -195,201 +195,200 @@ class Odf
}
}
$this->contentXml = str_replace('', $fonts . '', $this->contentXml);
- }
- else $convertedValue = preg_replace('/(\r\n|\r|\n)/i', "
", $value);
+ } else $convertedValue = preg_replace('/(\r\n|\r|\n)/i', "
", $value);
return $convertedValue;
}
/**
- * Replaces html tags in with odt tags and returns an odt string
- * @param array $tags An array with html tags generated by the getDataFromHtml() function
- * @param array $customStyles An array of style defenitions that should be included inside the odt file
- * @param array $fontDeclarations An array of font declarations that should be included inside the odt file
- * @return string
- */
- private function _replaceHtmlWithOdtTag($tags, &$customStyles, &$fontDeclarations)
+ * Replaces html tags in with odt tags and returns an odt string
+ * @param array $tags An array with html tags generated by the getDataFromHtml() function
+ * @param array $customStyles An array of style defenitions that should be included inside the odt file
+ * @param array $fontDeclarations An array of font declarations that should be included inside the odt file
+ * @return string
+ */
+ private function _replaceHtmlWithOdtTag($tags, &$customStyles, &$fontDeclarations)
{
- if ($customStyles == null) $customStyles = array();
- if ($fontDeclarations == null) $fontDeclarations = array();
+ if ($customStyles == null) $customStyles = array();
+ if ($fontDeclarations == null) $fontDeclarations = array();
- $odtResult = '';
+ $odtResult = '';
- foreach ((array) $tags as $tag) {
- // Check if the current item is a tag or just plain text
- if (isset($tag['text'])) {
- $odtResult .= $tag['text'];
- } elseif (isset($tag['name'])) {
- switch ($tag['name']) {
- case 'br':
- $odtResult .= '
';
- break;
- case 'strong':
- case 'b':
- $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
- break;
- case 'i':
- case 'em':
- $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
- break;
- case 'u':
- $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
- break;
- case 's':
- $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
- break;
- case 'sub':
- $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
- break;
- case 'sup':
- $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
- break;
- case 'span':
- if (isset($tag['attributes']['style'])) {
- $odtStyles = '';
- foreach ($tag['attributes']['style'] as $styleName => $styleValue) {
- switch ($styleName) {
- case 'font-family':
- $fontName = $styleValue;
- if (strpos($fontName, ',') !== false) {
- $fontName = explode(',', $fontName)[0];
- }
- if (!in_array($fontName, $fontDeclarations)) {
- array_push($fontDeclarations, $fontName);
- }
- $odtStyles .= '
';
- break;
- case 'font-size':
- if (preg_match('/([0-9]+)\s?(px|pt)/', $styleValue, $matches)) {
- $fontSize = intval($matches[1]);
- if ($matches[2] == 'px') {
- $fontSize = round($fontSize * 0.75);
- }
- $odtStyles .= '
';
- }
- break;
- case 'color':
- if (preg_match('/#[0-9A-Fa-f]{3}(?:[0-9A-Fa-f]{3})?/', $styleValue)) {
- $odtStyles .= '
';
- }
- break;
- }
- }
- if (strlen($odtStyles) > 0) {
+ foreach ((array) $tags as $tag) {
+ // Check if the current item is a tag or just plain text
+ if (isset($tag['text'])) {
+ $odtResult .= $tag['text'];
+ } elseif (isset($tag['name'])) {
+ switch ($tag['name']) {
+ case 'br':
+ $odtResult .= '
';
+ break;
+ case 'strong':
+ case 'b':
+ $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
+ break;
+ case 'i':
+ case 'em':
+ $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
+ break;
+ case 'u':
+ $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
+ break;
+ case 's':
+ $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
+ break;
+ case 'sub':
+ $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
+ break;
+ case 'sup':
+ $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
+ break;
+ case 'span':
+ if (isset($tag['attributes']['style'])) {
+ $odtStyles = '';
+ foreach ($tag['attributes']['style'] as $styleName => $styleValue) {
+ switch ($styleName) {
+ case 'font-family':
+ $fontName = $styleValue;
+ if (strpos($fontName, ',') !== false) {
+ $fontName = explode(',', $fontName)[0];
+ }
+ if (!in_array($fontName, $fontDeclarations)) {
+ array_push($fontDeclarations, $fontName);
+ }
+ $odtStyles .= '
';
+ break;
+ case 'font-size':
+ if (preg_match('/([0-9]+)\s?(px|pt)/', $styleValue, $matches)) {
+ $fontSize = intval($matches[1]);
+ if ($matches[2] == 'px') {
+ $fontSize = round($fontSize * 0.75);
+ }
+ $odtStyles .= '
';
+ }
+ break;
+ case 'color':
+ if (preg_match('/#[0-9A-Fa-f]{3}(?:[0-9A-Fa-f]{3})?/', $styleValue)) {
+ $odtStyles .= '
';
+ }
+ break;
+ }
+ }
+ if (strlen($odtStyles) > 0) {
// Generate a unique id for the style (using microtime and random because some CPUs are really fast...)
- $key = floatval(str_replace('.', '', microtime(true)))+rand(0, 10);
- $customStyles[$key] = $odtStyles;
- $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
- }
- }
- break;
- default:
- $odtResult .= $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations);
- break;
- }
- }
- }
- return $odtResult;
- }
+ $key = floatval(str_replace('.', '', microtime(true)))+rand(0, 10);
+ $customStyles[$key] = $odtStyles;
+ $odtResult .= '
' . ($tag['children'] != null ? $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations) : $tag['innerText']) . '';
+ }
+ }
+ break;
+ default:
+ $odtResult .= $this->_replaceHtmlWithOdtTag($tag['children'], $customStyles, $fontDeclarations);
+ break;
+ }
+ }
+ }
+ return $odtResult;
+ }
- /**
- * Checks if the given text is a html string
- * @param string $text The text to check
- * @return bool
- */
- private function _isHtmlTag($text)
+ /**
+ * Checks if the given text is a html string
+ * @param string $text The text to check
+ * @return bool
+ */
+ private function _isHtmlTag($text)
{
- return preg_match('/<([A-Za-z]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/', $text);
- }
+ return preg_match('/<([A-Za-z]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/', $text);
+ }
- /**
- * Checks if the given text includes a html string
- * @param string $text The text to check
- * @return bool
- */
- private function _hasHtmlTag($text)
+ /**
+ * Checks if the given text includes a html string
+ * @param string $text The text to check
+ * @return bool
+ */
+ private function _hasHtmlTag($text)
{
- $result = preg_match_all('/<([A-Za-z]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/', $text);
- return is_numeric($result) && $result > 0;
- }
+ $result = preg_match_all('/<([A-Za-z]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/', $text);
+ return is_numeric($result) && $result > 0;
+ }
- /**
- * Returns an array of html elements
- * @param string $html A string with html tags
- * @return array
- */
- private function _getDataFromHtml($html)
+ /**
+ * Returns an array of html elements
+ * @param string $html A string with html tags
+ * @return array
+ */
+ private function _getDataFromHtml($html)
{
- $tags = array();
- $tempHtml = $html;
+ $tags = array();
+ $tempHtml = $html;
- while (strlen($tempHtml) > 0) {
- // Check if the string includes a html tag
- if (preg_match_all('/<([A-Za-z]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/', $tempHtml, $matches)) {
- $tagOffset = strpos($tempHtml, $matches[0][0]);
- // Check if the string starts with the html tag
- if ($tagOffset > 0) {
- // Push the text infront of the html tag to the result array
- array_push($tags, array(
- 'text' => substr($tempHtml, 0, $tagOffset)
- ));
- // Remove the text from the string
- $tempHtml = substr($tempHtml, $tagOffset);
- }
- // Extract the attribute data from the html tag
- preg_match_all('/([0-9A-Za-z]+(?:="[0-9A-Za-z\:\-\s\,\;\#]*")?)+/', $matches[2][0], $explodedAttributes);
- $explodedAttributes = array_filter($explodedAttributes[0]);
- $attributes = array();
- // Store each attribute with its name in the $attributes array
- $explodedAttributesCount = count($explodedAttributes);
- for ($i=0; $i<$explodedAttributesCount; $i++) {
- $attribute = trim($explodedAttributes[$i]);
- // Check if the attribute has a value (like style="") or has no value (like required)
- if (strpos($attribute, '=') !== false) {
- $splitAttribute = explode('=', $attribute);
- $attrName = trim($splitAttribute[0]);
- $attrValue = trim(str_replace('"', '', $splitAttribute[1]));
- // check if the current attribute is a style attribute
- if (strtolower($attrName) == 'style') {
- $attributes[$attrName] = array();
- if (strpos($attrValue, ';') !== false) {
- // Split the style properties and store them in an array
- $explodedStyles = explode(';', $attrValue);
- $explodedStylesCount = count($explodedStyles);
- for ($n=0; $n<$explodedStylesCount; $n++) {
- $splitStyle = explode(':', $explodedStyles[$n]);
- $attributes[$attrName][trim($splitStyle[0])] = trim($splitStyle[1]);
- }
- } else {
- $splitStyle = explode(':', $attrValue);
- $attributes[$attrName][trim($splitStyle[0])] = trim($splitStyle[1]);
- }
- } else {
- // Store the value directly in the $attributes array if this is not the style attribute
- $attributes[$attrName] = $attrValue;
- }
- } else {
- $attributes[trim($attribute)] = true;
- }
- }
- // Push the html tag data to the result array
- array_push($tags, array(
- 'name' => $matches[1][0],
- 'attributes' => $attributes,
- 'innerText' => strip_tags($matches[3][0]),
- 'children' => $this->_hasHtmlTag($matches[3][0]) ? $this->_getDataFromHtml($matches[3][0]) : null
- ));
- // Remove the processed html tag from the html string
- $tempHtml = substr($tempHtml, strlen($matches[0][0]));
- } else {
- array_push($tags, array(
- 'text' => $tempHtml
- ));
- $tempHtml = '';
- }
- }
- return $tags;
- }
+ while (strlen($tempHtml) > 0) {
+ // Check if the string includes a html tag
+ if (preg_match_all('/<([A-Za-z]+)(?:\s([A-Za-z]+(?:\-[A-Za-z]+)?(?:=(?:".*?")|(?:[0-9]+))))*(?:(?:\s\/>)|(?:>(.*)<\/\1>))/', $tempHtml, $matches)) {
+ $tagOffset = strpos($tempHtml, $matches[0][0]);
+ // Check if the string starts with the html tag
+ if ($tagOffset > 0) {
+ // Push the text infront of the html tag to the result array
+ array_push($tags, array(
+ 'text' => substr($tempHtml, 0, $tagOffset)
+ ));
+ // Remove the text from the string
+ $tempHtml = substr($tempHtml, $tagOffset);
+ }
+ // Extract the attribute data from the html tag
+ preg_match_all('/([0-9A-Za-z]+(?:="[0-9A-Za-z\:\-\s\,\;\#]*")?)+/', $matches[2][0], $explodedAttributes);
+ $explodedAttributes = array_filter($explodedAttributes[0]);
+ $attributes = array();
+ // Store each attribute with its name in the $attributes array
+ $explodedAttributesCount = count($explodedAttributes);
+ for ($i=0; $i<$explodedAttributesCount; $i++) {
+ $attribute = trim($explodedAttributes[$i]);
+ // Check if the attribute has a value (like style="") or has no value (like required)
+ if (strpos($attribute, '=') !== false) {
+ $splitAttribute = explode('=', $attribute);
+ $attrName = trim($splitAttribute[0]);
+ $attrValue = trim(str_replace('"', '', $splitAttribute[1]));
+ // check if the current attribute is a style attribute
+ if (strtolower($attrName) == 'style') {
+ $attributes[$attrName] = array();
+ if (strpos($attrValue, ';') !== false) {
+ // Split the style properties and store them in an array
+ $explodedStyles = explode(';', $attrValue);
+ $explodedStylesCount = count($explodedStyles);
+ for ($n=0; $n<$explodedStylesCount; $n++) {
+ $splitStyle = explode(':', $explodedStyles[$n]);
+ $attributes[$attrName][trim($splitStyle[0])] = trim($splitStyle[1]);
+ }
+ } else {
+ $splitStyle = explode(':', $attrValue);
+ $attributes[$attrName][trim($splitStyle[0])] = trim($splitStyle[1]);
+ }
+ } else {
+ // Store the value directly in the $attributes array if this is not the style attribute
+ $attributes[$attrName] = $attrValue;
+ }
+ } else {
+ $attributes[trim($attribute)] = true;
+ }
+ }
+ // Push the html tag data to the result array
+ array_push($tags, array(
+ 'name' => $matches[1][0],
+ 'attributes' => $attributes,
+ 'innerText' => strip_tags($matches[3][0]),
+ 'children' => $this->_hasHtmlTag($matches[3][0]) ? $this->_getDataFromHtml($matches[3][0]) : null
+ ));
+ // Remove the processed html tag from the html string
+ $tempHtml = substr($tempHtml, strlen($matches[0][0]));
+ } else {
+ array_push($tags, array(
+ 'text' => $tempHtml
+ ));
+ $tempHtml = '';
+ }
+ }
+ return $tags;
+ }
/**
@@ -404,16 +403,15 @@ class Odf
// We convert html tags
$ishtml=dol_textishtml($value);
- if ($ishtml)
- {
- // If string is "MYPODUCT - Desc
bold with é accent
\n
\nUn texto en español ?"
- // Result after clean must be "MYPODUCT - Desc bold with é accent\n\nUn texto en español ?"
+ if ($ishtml) {
+ // If string is "MYPODUCT - Desc
bold with é accent
\n
\nUn texto en español ?"
+ // Result after clean must be "MYPODUCT - Desc bold with é accent\n\nUn texto en español ?"
// We want to ignore \n and we want all
to be \n
- $value=preg_replace('/(\r\n|\r|\n)/i','',$value);
- $value=preg_replace('/
/i',"\n",$value);
- $value=preg_replace('/
\/]*>/i',"\n",$value);
- $value=preg_replace('/
\/]*\/>/i',"\n",$value);
+ $value=preg_replace('/(\r\n|\r|\n)/i', '', $value);
+ $value=preg_replace('/
/i', "\n", $value);
+ $value=preg_replace('/
\/]*>/i', "\n", $value);
+ $value=preg_replace('/
\/]*\/>/i', "\n", $value);
//$value=preg_replace('/
/','__lt__text:p text:style-name=__quot__bold__quot____gt__',$value);
//$value=preg_replace('/<\/strong>/','__lt__/text:p__gt__',$value);
@@ -448,15 +446,14 @@ class Odf
*/
public function phpEval()
{
- preg_match_all('/[\{\<]\?(php)?\s+(?P.+)\?[\}\>]/iU',$this->contentXml, $matches); // detecting all {?php code ?} or
+ preg_match_all('/[\{\<]\?(php)?\s+(?P.+)\?[\}\>]/iU', $this->contentXml, $matches); // detecting all {?php code ?} or
$nbfound=count($matches['content']);
- for ($i=0; $i < $nbfound; $i++)
- {
+ for ($i=0; $i < $nbfound; $i++) {
try {
$ob_output = ''; // flush the output for each code. This var will be filled in by the eval($code) and output buffering : any print or echo or output will be redirected into this variable
$code = $matches['content'][$i];
ob_start();
- eval ($code);
+ eval($code);
$ob_output = ob_get_contents(); // send the content of the buffer into $ob_output
$this->contentXml = str_replace($matches[0][$i], $ob_output, $this->contentXml);
ob_end_clean();
@@ -503,12 +500,12 @@ IMG;
*/
private function _moveRowSegments()
{
- // Replace BEGINxxx into BEGIN xxx
- $this->contentXml = preg_replace('/\[!--\sBEGIN]>(row.[\S]*)\s--\]/sm', '[!-- BEGIN \\1 --]', $this->contentXml);
- // Replace ENDxxx into END xxx
- $this->contentXml = preg_replace('/\[!--\sEND]>(row.[\S]*)\s--\]/sm', '[!-- END \\1 --]', $this->contentXml);
+ // Replace BEGINxxx into BEGIN xxx
+ $this->contentXml = preg_replace('/\[!--\sBEGIN]>(row.[\S]*)\s--\]/sm', '[!-- BEGIN \\1 --]', $this->contentXml);
+ // Replace ENDxxx into END xxx
+ $this->contentXml = preg_replace('/\[!--\sEND]>(row.[\S]*)\s--\]/sm', '[!-- END \\1 --]', $this->contentXml);
- // Search all possible rows in the document
+ // Search all possible rows in the document
$reg1 = "#]*>(.*)#smU";
preg_match_all($reg1, $this->contentXml, $matches);
for ($i = 0, $size = count($matches[0]); $i < $size; $i++) {
@@ -536,31 +533,27 @@ IMG;
* @param string $type 'content', 'styles' or 'meta'
* @return void
*/
- private function _parse($type='content')
+ private function _parse($type = 'content')
{
- // Search all tags fou into condition to complete $this->vars, so we will proceed all tests even if not defined
- $reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
- preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER);
+ // Search all tags fou into condition to complete $this->vars, so we will proceed all tests even if not defined
+ $reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
+ preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER);
- //var_dump($this->vars);exit;
- foreach($matches as $match) // For each match, if there is no entry into this->vars, we add it
- {
- if (! empty($match[1]) && ! isset($this->vars[$match[1]]))
- {
- $this->vars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop
+ //var_dump($this->vars);exit;
+ foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it
+ if (! empty($match[1]) && ! isset($this->vars[$match[1]])) {
+ $this->vars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop
}
- }
- //var_dump($this->vars);exit;
+ }
+ //var_dump($this->vars);exit;
// Conditionals substitution
// Note: must be done before static substitution, else the variable will be replaced by its value and the conditional won't work anymore
- foreach($this->vars as $key => $value)
- {
+ foreach ($this->vars as $key => $value) {
// If value is true (not 0 nor false nor null nor empty string)
- if ($value)
- {
- //dol_syslog("Var ".$key." is defined, we remove the IF, ELSE and ENDIF ");
- //$sav=$this->contentXml;
+ if ($value) {
+ //dol_syslog("Var ".$key." is defined, we remove the IF, ELSE and ENDIF ");
+ //$sav=$this->contentXml;
// Remove the IF tag
$this->contentXml = str_replace('[!-- IF '.$key.' --]', '', $this->contentXml);
// Remove everything between the ELSE tag (if it exists) and the ENDIF tag
@@ -568,27 +561,26 @@ IMG;
$this->contentXml = preg_replace($reg, '', $this->contentXml);
/*if ($sav != $this->contentXml)
{
- dol_syslog("We found a IF and it was processed");
- //var_dump($sav);exit;
+ dol_syslog("We found a IF and it was processed");
+ //var_dump($sav);exit;
}*/
}
// Else the value is false, then two cases: no ELSE and we're done, or there is at least one place where there is an ELSE clause, then we replace it
- else
- {
- //dol_syslog("Var ".$key." is not defined, we remove the IF, ELSE and ENDIF ");
- //$sav=$this->contentXml;
+ else {
+ //dol_syslog("Var ".$key." is not defined, we remove the IF, ELSE and ENDIF ");
+ //$sav=$this->contentXml;
// Find all conditional blocks for this variable: from IF to ELSE and to ENDIF
$reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER);
- foreach($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
+ foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
if (!empty($match[3])) $this->contentXml = str_replace($match[0], $match[3], $this->contentXml);
}
// Cleanup the other conditional blocks (all the others where there were no ELSE clause, we can just remove them altogether)
$this->contentXml = preg_replace($reg, '', $this->contentXml);
/*if ($sav != $this->contentXml)
{
- dol_syslog("We found a IF and it was processed");
- //var_dump($sav);exit;
+ dol_syslog("We found a IF and it was processed");
+ //var_dump($sav);exit;
}*/
}
}
@@ -597,7 +589,6 @@ IMG;
if ($type == 'content') $this->contentXml = str_replace(array_keys($this->vars), array_values($this->vars), $this->contentXml);
if ($type == 'styles') $this->stylesXml = str_replace(array_keys($this->vars), array_values($this->vars), $this->stylesXml);
if ($type == 'meta') $this->metaXml = str_replace(array_keys($this->vars), array_values($this->vars), $this->metaXml);
-
}
/**
@@ -737,21 +728,19 @@ IMG;
*/
public function setMetaData()
{
- if (empty($this->creator)) $this->creator='';
+ if (empty($this->creator)) $this->creator='';
$this->metaXml = preg_replace('/.*<\/dc:date>/', ''.gmdate("Y-m-d\TH:i:s").'', $this->metaXml);
$this->metaXml = preg_replace('/.*<\/dc:creator>/', ''.htmlspecialchars($this->creator).'', $this->metaXml);
$this->metaXml = preg_replace('/.*<\/dc:title>/', ''.htmlspecialchars($this->title).'', $this->metaXml);
$this->metaXml = preg_replace('/.*<\/dc:subject>/', ''.htmlspecialchars($this->subject).'', $this->metaXml);
- if (count($this->userdefined))
- {
- foreach($this->userdefined as $key => $val)
- {
- $this->metaXml = preg_replace('', '', $this->metaXml);
- $this->metaXml = preg_replace('/.*<\/meta:user-defined>/', '', $this->metaXml);
- $this->metaXml = str_replace('', ''.htmlspecialchars($val).'', $this->metaXml);
- }
+ if (count($this->userdefined)) {
+ foreach ($this->userdefined as $key => $val) {
+ $this->metaXml = preg_replace('', '', $this->metaXml);
+ $this->metaXml = preg_replace('/.*<\/meta:user-defined>/', '', $this->metaXml);
+ $this->metaXml = str_replace('', ''.htmlspecialchars($val).'', $this->metaXml);
+ }
}
}
@@ -785,8 +774,7 @@ IMG;
throw new OdfException("headers already sent ($filename at $linenum)");
}
- if( $name == "" )
- {
+ if ( $name == "" ) {
$name = md5(uniqid()) . ".odt";
}
@@ -804,11 +792,11 @@ IMG;
* @throws OdfException
* @return void
*/
- public function exportAsAttachedPDF($name="")
+ public function exportAsAttachedPDF($name = "")
{
global $conf;
- if( $name == "" ) $name = "temp".md5(uniqid());
+ if ( $name == "" ) $name = "temp".md5(uniqid());
dol_syslog(get_class($this).'::exportAsAttachedPDF $name='.$name, LOG_DEBUG);
$this->saveToDisk($name);
@@ -818,8 +806,7 @@ IMG;
// Export to PDF using LibreOffice
- if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice')
- {
+ if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice') {
dol_mkdir($conf->user->dir_temp); // We must be sure the directory exists and is writable
// We delete and recreate a subdir because the soffice may have change pemrissions on it
@@ -831,9 +818,7 @@ IMG;
// using linux/mac libreoffice that must be in path
// Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1
$command ='soffice --headless -env:UserInstallation=file:\''.$conf->user->dir_temp.'/odtaspdf\' --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name);
- }
- elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF))
- {
+ } elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF)) {
// If issue with unoconv, see https://github.com/dagwieers/unoconv/issues/87
// MAIN_ODT_AS_PDF should be "sudo -u unoconv /usr/bin/unoconv" and userunoconv must have sudo to be root by adding file /etc/sudoers.d/unoconv with content www-data ALL=(unoconv) NOPASSWD: /usr/bin/unoconv .
@@ -860,19 +845,14 @@ IMG;
$command = $conf->global->MAIN_ODT_AS_PDF.' '.escapeshellcmd($name);
//$command = '/usr/bin/unoconv -vvv '.escapeshellcmd($name);
- }
- else
- {
+ } else {
// deprecated old method using odt2pdf.sh (native, jodconverter, ...)
$tmpname=preg_replace('/\.odt/i', '', $name);
- if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT))
- {
+ if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT)) {
$command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($tmpname).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
- }
- else
- {
- dol_syslog(get_class($this).'::exportAsAttachedPDF is used but the constant MAIN_DOL_SCRIPTS_ROOT with path to script directory was not defined.', LOG_WARNING);
+ } else {
+ dol_syslog(get_class($this).'::exportAsAttachedPDF is used but the constant MAIN_DOL_SCRIPTS_ROOT with path to script directory was not defined.', LOG_WARNING);
$command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($tmpname).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
}
}
@@ -880,25 +860,26 @@ IMG;
//$dirname=dirname($name);
//$command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name.' '.$dirname;
- dol_syslog(get_class($this).'::exportAsAttachedPDF $execmethod='.$execmethod.' Run command='.$command,LOG_DEBUG);
+ dol_syslog(get_class($this).'::exportAsAttachedPDF $execmethod='.$execmethod.' Run command='.$command, LOG_DEBUG);
+ // TODO Use:
+ // $outputfile = DOL_DATA_ROOT.'/odt2pdf.log';
+ // $result = $utils->executeCLI($command, $outputfile); and replace test on $execmethod.
+ // $retval will be $result['result']
+ // $errorstring will be $result['output']
$retval=0; $output_arr=array();
- if ($execmethod == 1)
- {
+ if ($execmethod == 1) {
exec($command, $output_arr, $retval);
}
- if ($execmethod == 2)
- {
+ if ($execmethod == 2) {
$outputfile = DOL_DATA_ROOT.'/odt2pdf.log';
$ok=0;
$handle = fopen($outputfile, 'w');
- if ($handle)
- {
- dol_syslog(get_class($this)."Run command ".$command,LOG_DEBUG);
+ if ($handle) {
+ dol_syslog(get_class($this)."Run command ".$command, LOG_DEBUG);
fwrite($handle, $command."\n");
$handlein = popen($command, 'r');
- while (!feof($handlein))
- {
+ while (!feof($handlein)) {
$read = fgets($handlein);
fwrite($handle, $read);
$output_arr[]=$read;
@@ -909,8 +890,7 @@ IMG;
if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK));
}
- if ($retval == 0)
- {
+ if ($retval == 0) {
dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG);
$filename=''; $linenum=0;
@@ -927,8 +907,7 @@ IMG;
}
}
- if (!empty($conf->global->MAIN_ODT_AS_PDF_DEL_SOURCE))
- {
+ if (!empty($conf->global->MAIN_ODT_AS_PDF_DEL_SOURCE)) {
unlink($name);
}
} else {
@@ -937,11 +916,10 @@ IMG;
if ($retval == 126) {
throw new OdfException('Permission execute convert script : ' . $command);
- }
- else {
- $errorstring='';
- foreach($output_arr as $line) {
- $errorstring.= $line."
";
+ } else {
+ $errorstring='';
+ foreach ($output_arr as $line) {
+ $errorstring.= $line."
";
}
throw new OdfException('ODT to PDF convert fail (option MAIN_ODT_AS_PDF is '.$conf->global->MAIN_ODT_AS_PDF.', command was '.$command.', retval='.$retval.') : ' . $errorstring);
}
diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php
index 21e922a9fa7..1b3cc468e5c 100644
--- a/htdocs/margin/tabs/thirdpartyMargins.php
+++ b/htdocs/margin/tabs/thirdpartyMargins.php
@@ -142,7 +142,7 @@ if ($socid > 0) {
// Total Margin
print '| '.$langs->trans("TotalMargin").' | ';
- print ''; // set by jquery (see below)
+ print ''; // set by jquery (see below)
print ' |
';
// Margin Rate
@@ -242,9 +242,9 @@ if ($socid > 0) {
print "\n";
print "";
print dol_print_date($db->jdate($objp->datef), 'day')." | ";
- print "".price(price2num($objp->selling_price, 'MT'))." | \n";
- print "".price(price2num(($objp->type == 2 ? -1 : 1) * $objp->buying_price, 'MT'))." | \n";
- print "".$sign.price(price2num($objp->marge, 'MT'))." | \n";
+ print "".price(price2num($objp->selling_price, 'MT'))." | \n";
+ print "".price(price2num(($objp->type == 2 ? -1 : 1) * $objp->buying_price, 'MT'))." | \n";
+ print "".$sign.price(price2num($objp->marge, 'MT'))." | \n";
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
print "".(($marginRate === '') ? 'n/a' : $sign.price(price2num($marginRate, 'MT'))."%")." | \n";
}
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 6046a960b45..71489fb3b1b 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -2640,7 +2640,7 @@ table.login_table_securitycode tr td {
}
div.backgroundsemitransparent {
- background:rgba(255,255,255,0.68);
+ background:rgba(255, 255, 255, 0.7);
padding-left: 10px;
padding-right: 10px;
}
@@ -3922,6 +3922,11 @@ table.noborder.paymenttable {
box-shadow: 1px 1px 7px #CCC !important;
}
+.boxshadow {
+ -webkit-box-shadow: 0px 0px 5px #888;
+ box-shadow: 0px 0px 5px #888;
+}
+
div.tabBar .noborder {
-webkit-box-shadow: 0px 0px 0px #DDD !important;
box-shadow: 0px 0px 0px #DDD !important;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 8a642a0e170..5bd074b31d5 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -1862,7 +1862,7 @@ div.login_block {
div.backgroundsemitransparent {
- background:rgba(255,255,255,0.6);
+ background:rgba(255, 255, 255, 0.7);
padding-left: 10px;
padding-right: 10px;
}
@@ -3943,6 +3943,11 @@ tr.liste_sub_total, tr.liste_sub_total td {
box-shadow: 2px 2px 5px #CCC !important;
}
+.boxshadow {
+ -webkit-box-shadow: 0px 0px 5px #888;
+ box-shadow: 0px 0px 5px #888;
+}
+
div.tabBar .noborder {
-webkit-box-shadow: 0px 0px 0px #f4f4f4 !important;
box-shadow: 0px 0px 0px #f4f4f4 !important;
diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php
index b474bdfc678..928db5449d8 100644
--- a/htdocs/user/agenda_extsites.php
+++ b/htdocs/user/agenda_extsites.php
@@ -188,7 +188,7 @@ print '';
print "";
print "| ".$langs->trans("Parameter")." | ";
print "".$langs->trans("Name")." | ";
-print "".$langs->trans("ExtSiteUrlAgenda").' '." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics) | ';
+print "".$langs->trans("ExtSiteUrlAgenda").' '." (".$langs->trans("Example").': https://externalcalendar/agenda/agenda.ics) | ';
print "".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).' | ';
print ''.$langs->trans("Color").' | ';
print "
";
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index ef7136e2450..1efbdb18714 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -1421,10 +1421,12 @@ if ($action == 'create' || $action == 'adduserldap') {
if ($object->socid > 0) {
$type = $langs->trans("External");
}
+ print '';
print $type;
if ($object->ldap_sid) {
print ' ('.$langs->trans("DomainUser").')';
}
+ print '';
print ''."\n";
// Ldap sid
@@ -1534,7 +1536,7 @@ if ($action == 'create' || $action == 'adduserldap') {
// Salary
print '| '.$langs->trans("Salary").' | ';
print '';
- print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '');
+ print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').'';
print ' | ';
print "
\n";
}
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 63f33b5f8ec..32fa93cb8a6 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -128,7 +128,7 @@ if (empty($reshook)) {
}
if ($result <= 0 && $edituser->error == 'USERNOTFOUND') {
- $message = '';
+ $message = '
';
if (!$isanemail) {
$message .= $langs->trans("IfLoginExistPasswordRequestSent");
} else {
@@ -147,7 +147,7 @@ if (empty($reshook)) {
} else {
// Success
if ($edituser->send_password($user, $newpassword, 1) > 0) {
- $message = '
';
+ $message = '
';
if (!$isanemail) {
$message .= $langs->trans("IfLoginExistPasswordRequestSent");
} else {
diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php
index 63c52ac60c5..16cc8438c91 100644
--- a/test/phpunit/SecurityTest.php
+++ b/test/phpunit/SecurityTest.php
@@ -798,8 +798,8 @@ class SecurityTest extends PHPUnit\Framework\TestCase
$result=dol_sanitizeFileName('bad file | evilaction');
$this->assertEquals('bad file _ evilaction', $result);
- $result=dol_sanitizeFileName('bad file --evilparam');
- $this->assertEquals('bad file _evilparam', $result);
+ $result=dol_sanitizeFileName('bad file -evilparam --evilparam ---evilparam ----evilparam');
+ $this->assertEquals('bad file _evilparam _evilparam _evilparam _evilparam', $result);
}
/**