diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 505f8f63118..e3298a7fe12 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1408,7 +1408,9 @@ class Propal extends CommonObject
}
// reset ref_client
- $object->ref_client = '';
+ if (!getDolGlobalString('MAIN_KEEP_REF_CUSTOMER_ON_CLONING')) {
+ $object->ref_client = '';
+ }
// TODO Change product price if multi-prices
} else {
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index ca326240d1e..c06d7eef8e8 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -8214,6 +8214,9 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
}
}
+ // Clear ZERO WIDTH NO-BREAK SPACE, ZERO WIDTH SPACE, ZERO WIDTH JOINER
+ $out = preg_replace('/[\x{200B}-\x{200D}\x{FEFF}]/u', ' ', $out);
+
// Clean some html entities that are useless so text is cleaner
$out = preg_replace('/&(tab|newline);/i', ' ', $out);
@@ -8324,6 +8327,7 @@ function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UT
if ($removelasteolbr) {
$newstring = preg_replace('/
$/i', '', $newstring); // Remove last
(remove only last one)
}
+ $newstring = preg_replace('/[\x{200B}-\x{200D}\x{FEFF}]/u', ' ', $newstring);
$newstring = strtr($newstring, array('&' => '__and__', '<' => '__lt__', '>' => '__gt__', '"' => '__dquot__'));
$newstring = dol_htmlentities($newstring, ENT_COMPAT, $pagecodefrom); // Make entity encoding
$newstring = strtr($newstring, array('__and__' => '&', '__lt__' => '<', '__gt__' => '>', '__dquot__' => '"'));
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index 25d455b4b00..51405083fe6 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -858,11 +858,11 @@ class pdf_espadon extends ModelePdfExpedition
$object->volume_units = (float) $object->size_units * 3;
}
- if ($totalWeight != '') {
- $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
+ if (!empty($totalWeight)) {
+ $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1);
}
- if ($totalVolume != '') {
- $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
+ if (!empty($totalVolume)) {
+ $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
}
if (!empty($object->trueWeight)) {
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index 20a809ea36a..875525811e4 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -750,11 +750,11 @@ class pdf_rouget extends ModelePdfExpedition
$object->volume_units = (float) $object->size_units * 3;
}
- if ($totalWeight != '') {
- $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
+ if (!empty($totalWeight)) {
+ $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1);
}
- if ($totalVolume != '') {
- $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
+ if (!empty($totalVolume)) {
+ $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
}
if (!empty($object->trueWeight)) {
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php
index 0b41a315145..f8945ad74cb 100644
--- a/htdocs/public/project/new.php
+++ b/htdocs/public/project/new.php
@@ -215,7 +215,7 @@ if (empty($reshook) && $action == 'add') {
if (!$error) {
// Search thirdparty and set it if found to the new created project
- $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', $object->email);
+ $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', GETPOST('email'));
if ($result > 0) {
$proj->socid = $thirdparty->id;
} else {