Skip to content

Conversation

Mathias-DS
Copy link
Contributor

Test for null value in strpos in QueryCollector.php to solve laravel-debugbar issue #1775 and snipe-it issue 16476.

Test for null value in strpos in QueryCollector.php to solve laravel-debugbar issue barryvdh#1775 and snipe-it issue 16476.

foreach ($this->middleware as $alias => $class) {
if (strpos($class, $filename) !== false) {
if (!is_null($class) && !is_null($filename) && strpos($class, $filename) !== false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't it be something simpler? like

if ($class && strpos($class, (string) $filename) !== false) {
Suggested change
if (!is_null($class) && !is_null($filename) && strpos($class, $filename) !== false) {
if ($class && strpos($class, (string) $filename) !== false) {

@barryvdh barryvdh merged commit 611c2d1 into barryvdh:master Apr 8, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants