diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index 17230c475b5..d3adfa4d234 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -729,7 +729,7 @@ if ($_GET["id"])
// Note
print '
| '.$langs->trans("Note").' | ';
- print nl2br($act->note);
+ print nl2br(htmlentities($act->note));
print ' |
';
print '';
diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql
index 376a9520a40..850b66338bc 100644
--- a/mysql/migration/2.0.0-2.1.0.sql
+++ b/mysql/migration/2.0.0-2.1.0.sql
@@ -101,7 +101,9 @@ alter table llx_actioncomm add column tms timestamp after datea;
alter table llx_actioncomm add column fk_commande integer after propalrowid;
update llx_actioncomm set datec = datea where datec is null;
-update llx_actioncomm set datep = datea where datep is null;
+update llx_actioncomm set datep = datea where datep is null AND percent < 100;
+update llx_actioncomm set datep = datec where datea is null AND datep is null AND percent < 100;
+update llx_actioncomm set datea = datec where datea is null AND datep is null AND percent = 100;
update llx_actioncomm set fk_action = '8' where fk_action = '3' and label = 'Envoi commande par mail';