From 9cb16da73fdc3c8a8f4ad25401655b02070d2055 Mon Sep 17 00:00:00 2001 From: Muhammad Ahmed Date: Mon, 26 Aug 2024 16:22:04 +0500 Subject: [PATCH] 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. --- app/Abstracts/Notification.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Abstracts/Notification.php b/app/Abstracts/Notification.php index a9ab9aabf..9e8d0c752 100644 --- a/app/Abstracts/Notification.php +++ b/app/Abstracts/Notification.php @@ -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;