Skip to content

Bug: Model::getValidationRules() cant handle ::$validationRules if its a string #3039

Description

@element-code

Describe the bug
When calling CodeIgniter\Model::getValidationRules() (as described here) we get a TypeError or a error from array_diff_key or array_intersect_key in case were using options.
This is caused by ::getValidationRules not checking for string / lookup like it happens in ::validate().

Always using ::getValidationRules instead of internal accessing them in ::validate() would be better and minimize the possibility of not checking for is_string :)

CodeIgniter 4 version
development

Affected module(s)
Codeigniter\Model

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions