Skip to content

checkAndSanitizeRequiredParameters doesn't detect hookable sanitizer methods #45

@jlahijani

Description

@jlahijani

I want to sanitize an array, and even though 'array' is a method on ProcessWire's sanitizer class, it's technically a hookable method and therefore the method name is ___array. As a result of, checkAndSanitizeRequiredParameters will not detect it and error.

This line should be changed from this:

if (!method_exists(wire('sanitizer'), $sanitizer)) {

To this:

if (!method_exists(wire('sanitizer'), $sanitizer) && !method_exists(wire('sanitizer'), '___'.$sanitizer)) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions