Fix deprecation warning in Notification.php by handling null values in preg_quote()

Addressed a deprecation warning in `Notification.php` related to the `preg_quote()` function. The warning occurred because `preg_quote()` was being passed `null` values, which is deprecated in PHP 8.2.
This commit is contained in:
Muhammad Ahmed 2024-08-26 16:22:04 +05:00 committed by GitHub
parent b9057afd08
commit 9cb16da73f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -146,7 +146,8 @@ abstract class Notification extends BaseNotification implements ShouldQueue
$new_vars = [];
foreach ($vars as $var) {
$new_vars[] = preg_quote($var);
// Ensure $var is a string, default to an empty string if it is null
$new_vars[] = preg_quote($var ?? '');
}
return $new_vars;