Disable Dolibarr filter on email addresses and subject

'was wondering if the filter change of Dolibarr 13 might have affected
something else and, well, yes...

So, following e1ac0a6d69, we also disable the
filter for the email addresses, else we get something like
"Webmaster <webmaster@bugness.org>" becoming "Webmaster".
This commit is contained in:
Chl 2024-08-19 23:39:29 +02:00
parent ab5a9c2861
commit f94ba084a3

View file

@ -103,7 +103,7 @@ do {
if (GETPOST('save')) { if (GETPOST('save')) {
do { do {
// Validate input data // Validate input data
if (! array_key_exists(GETPOST('fromtype', 'alpha'), $listFrom)) { if (! array_key_exists(GETPOST('fromtype'), $listFrom)) {
setEventMessages('Unexpected from value', null, 'errors'); setEventMessages('Unexpected from value', null, 'errors');
break; break;
} }
@ -116,13 +116,13 @@ do {
break; break;
} }
// Validate some non-breaking stuff after feeding // Validate some non-breaking stuff after feeding
if (empty(GETPOST('sendto_free', 'alpha')) && empty(GETPOST('sendto_socpeople', 'array'))) { if (empty(GETPOST('sendto_free', 'none')) && empty(GETPOST('sendto_socpeople', 'array'))) {
// Kinda weird behaviour from CMailFile but better alert the user beforehand // Kinda weird behaviour from CMailFile but better alert the user beforehand
// FIXME: check if there is a workaround ? // FIXME: check if there is a workaround ?
setEventMessages("In some configuration, CMailFile doesn't allow empty 'to' recipient. You should set at least one.", null, 'warnings'); setEventMessages("In some configuration, CMailFile doesn't allow empty 'to' recipient. You should set at least one.", null, 'warnings');
//break; //break;
} }
if (! strlen(GETPOST('subject', 'alpha'))) { if (! strlen(GETPOST('subject', 'none'))) {
// Kinda weird behaviour from CMailFile but better alert the user beforehand // Kinda weird behaviour from CMailFile but better alert the user beforehand
// FIXME: check if there is a workaround ? // FIXME: check if there is a workaround ?
setEventMessages("In some configuration, CMailFile doesn't allow empty subject. You should set one.", null, 'warnings'); setEventMessages("In some configuration, CMailFile doesn't allow empty subject. You should set one.", null, 'warnings');
@ -140,10 +140,10 @@ do {
$mailObject->fromtype = GETPOST('fromtype', 'alpha'); $mailObject->fromtype = GETPOST('fromtype', 'alpha');
$mailObject->frommail = $listFrom[$mailObject->fromtype]; $mailObject->frommail = $listFrom[$mailObject->fromtype];
$mailObject->sendto_free = GETPOST('sendto_free', 'alpha'); $mailObject->sendto_free = GETPOST('sendto_free', 'none');
$mailObject->sendto_thirdparty = in_array('thirdparty', GETPOST('sendto_socpeople', 'array')); $mailObject->sendto_thirdparty = in_array('thirdparty', GETPOST('sendto_socpeople', 'array'));
$mailObject->sendcc_free = GETPOST('sendcc_free', 'alpha'); $mailObject->sendcc_free = GETPOST('sendcc_free', 'none');
$mailObject->sendcc_thirdparty = in_array('thirdparty', GETPOST('sendcc_socpeople', 'array')); $mailObject->sendcc_thirdparty = in_array('thirdparty', GETPOST('sendcc_socpeople', 'array'));
$mailObject->subject = GETPOST('subject', 'none'); $mailObject->subject = GETPOST('subject', 'none');