Whitespace in the middle of a tracking number will break the link when (#37501)

the user tries to follow the shipping, so we remove all whitespace.
This commit is contained in:
Rikard Bosnjakovic 2026-03-15 12:24:15 +01:00 committed by GitHub
parent bc29bc1a8a
commit 6f4c1ef972
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -769,6 +769,7 @@ if (empty($reshook)) {
if ($action == 'settracking_number') { // Test on permission not required
$object->tracking_number = trim(GETPOST('tracking_number', 'alpha'));
$object->tracking_number = preg_replace('/\s+/', '', $object->tracking_number);
}
if ($action == 'settracking_url') { // Test on permission not required
$object->tracking_url = trim(GETPOST('tracking_url', 'restricthtml'));

View file

@ -432,6 +432,8 @@ class Expedition extends CommonObject
// Clean parameters
$this->tracking_number = dol_sanitizeFileName((string) $this->tracking_number);
$this->tracking_number = preg_replace('/\s+/', '', $this->tracking_number);
if (empty($this->fk_project)) {
$this->fk_project = 0;
}