YorCreative / Laravel-Scrubber

A Laravel package to scrub sensitive information that breaks operational security policies from being leaked on accident or not by developers.
MIT License
140 stars 12 forks source link

[Patch] NullHandler class cannot be tapped. #31

Closed yordadev closed 1 year ago

yordadev commented 1 year ago

Small adjustment to the ScrubberTap class to skip the NullHandler class when tapping into Laravel's logging functionality.

This PR, contributed by @Magentron, addresses the issue with tapping into the NullHandler class in Laravel's logging functionality. https://github.com/YorCreative/Laravel-Scrubber/issues/29 highlighted that tapping into the NullHandler can cause errors and issues.

To resolve this issue, this PR makes a small adjustment to the ScrubberTap class. The change checks if the handler is not an instance of NullHandler before pushing the message processing function to the handler, ensuring that the NullHandler is not tapped as it cannot be tapped. This helps to avoid any potential errors or issues that may arise from attempting to tap the NullHandler.

Thanks to @Magentron for contributing this fix.