Skip to content

Fix deprecation warning in Notification.php by handling null values i… #3207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Conversation

callmeahmedr
Copy link
Contributor

@callmeahmedr callmeahmedr commented Aug 26, 2024

Addressing Issue #3205

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

Description:
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.

Changes Made:

  • Updated the loop that processes the $vars array to ensure that each element passed to preg_quote() is a string. Added a default value of an empty string ('') when the element is null.

Code Changes:

foreach ($vars as $var) {
    // Ensure $var is a string, default to an empty string if it is null
    $new_vars[] = preg_quote($var ?? '');
}

…n 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.
@cuneytsenturk cuneytsenturk added this to the 3.1.12 milestone Aug 30, 2024
@cuneytsenturk cuneytsenturk merged commit 4f523fe into akaunting:master Aug 30, 2024
@callmeahmedr callmeahmedr deleted the patch-1 branch August 30, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants