⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@eliashaeussler
Copy link

This PR implements a new rule for unserialize. Following behaviors will trigger an error:

  • Parameter $2 options is NOT set (only with parameter checkInsecureUnserialize: true)
  • Parameter $2 options has an invalid array key (neither allowed_classes nor max_depth)
  • Parameter $2 options has invalid type for allowed_classes
  • Parameter $2 options has 'allowed_classes' => true (only with parameter checkInsecureUnserialize: true)
  • Parameter $2 options has invalid array item for allowed_classes
  • Parameter $2 options has max_depth key on PHP < 7.4
  • Parameter $2 options has invalid type for max_depth
  • Parameter $2 options is set, but does not have allowed_classes configured (only with parameter checkInsecureUnserialize: true)

$this->analyse([__DIR__ . '/data/unserialize.php'], $expectedErrors);
}

#[RequiresPhp('< 7.4')]
Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure whether to keep this test case, since it does not seem like PHP < 7.4 is actually included in the test matrix.

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.

1 participant