mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
adds check for email characters only being ASCII
This commit is contained in:
parent
77c978d29a
commit
569110d1ff
|
@ -52,7 +52,17 @@ class SendExpectedCheckinAlerts extends Command
|
||||||
|
|
||||||
|
|
||||||
foreach ($assets as $asset) {
|
foreach ($assets as $asset) {
|
||||||
if ($asset->assignedTo && (isset($asset->assignedTo->email)) && ($asset->assignedTo->email!='') && $asset->checkedOutToUser()) {
|
if ($asset->assignedTo
|
||||||
|
&& (isset($asset->assignedTo->email))
|
||||||
|
&& ($asset->assignedTo->email!='')
|
||||||
|
&& $asset->checkedOutToUser()) {
|
||||||
|
$email = $asset->assignedTo->email;
|
||||||
|
// Check if the email contains only ASCII characters
|
||||||
|
if (!preg_match('/^[\x00-\x7F]+$/', $email)) {
|
||||||
|
$this->info("Skipping invalid email: {$email}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$this->info('Sending User ExpectedCheckinNotification to: '.$asset->assignedTo->email);
|
$this->info('Sending User ExpectedCheckinNotification to: '.$asset->assignedTo->email);
|
||||||
$asset->assignedTo->notify((new ExpectedCheckinNotification($asset)));
|
$asset->assignedTo->notify((new ExpectedCheckinNotification($asset)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue