Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 3.5.0
-
Fix Version/s: None
-
Component/s: Modules
-
Labels:None
Description
The Module abstract class component defines a validateService method that returns boolean, and accepts input data in a $vars array. The method is intended to be used to perform top-level error checking, typically using the Input component. However, rules validated through the Input component can have their values changed in 'pre_format' and 'post_format'.
Since input vars are not returned to the caller, it is not known whether the values have changed, for example, to trim() white space off of input data automatically before validation.
tl;dr
Consider allowing the $vars argument to Module::validateService to be passed by reference.
This could result in invalid pass by reference requests due to the caller passing a function call, for example.
Not sure we want the validateService to be able to manipulate the input, but if we did, I think we'd need to set it as a separate input parameter, similar to preg_match to handle the result.