forked from splittingred/FormIt
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
islowercase validator not working (solved) #251
Comments
patrickatwsrn
changed the title
islowercase validator not working
islowercase validator not working (solved)
May 25, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Before you read this...
The problem was caused because I have a habit of putting commas in front of the following line:
This breaks the validation.
This works.
In a similar bug report reported by me the issue was caused by the same problem.
Bug report
Summary
islowercase always seems to return true, regardless of validated content.
Step to reproduce
Observed behavior
Insert string "lower"
After submiting the form:
Insert string "LOWER"
After submiting the form:
"name" is marked as an error because it is required
"islowercase" is not marked even though it containes uppercase letters. BAD
"name" is marked as an error because it is required
"islowercase" is not marked because containes uppercase letters. GOOD
It doesn't matter what goes into the lowercasetext. The validator never returns an error. BAD
Possible Problems
This does not seem to be related to the lexicon file, because there is a string for this error:
Ths issue should be located in validator.php, but to be honest I can't see what could ever go wrong here:
core/components/formit/src/FormIt/Validator.php, LINE # 678
According to my phpinfo page "Multibyte decoding support using mbstring" is enabled and the setting for "use_multibyte" is true. Comparing the original value with the strtolower or mb_strtolower.
Question: What is $this->config['encoding'] supposed to return? It is not a setting that can be displayed on the settings page. Neither core nor formit have this variable.
Expected behavior
"LOWER" should return an error. BAD
"lower" should not return an error. FINE
Environment
MODX 2.8.1, Formit 4.2.6 , PHP 7.4.18, Apache Webserver Running on Ubuntu Linux.
The text was updated successfully, but these errors were encountered: