You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm encountering a discrepancy in the behavior of the StringLength validator between my local environment and my test server.
It seems that on the local environment, the validation fails when strlen() >= max, while on the test server, it fails when strlen() > max (with includedMaximum set to false).
To Reproduce
Use the Phalcon\Validation\Validator\StringLength validator with the following configuration:
$validator->add('hash', new \Phalcon\Validation\Validator\StringLength\Max([
"max" => 32,
"messageMaximum" => "Field hash must be less than 32 characters"
]));
Set includedMaximum to false (default behavior).
Validate an MD5 hash (which is always exactly 32 characters long).
Expected Behavior:
Since "includedMaximum" is false, validation should pass for strings with up to 32 characters and fail for 33 characters, according to the source code.
Observed Behavior:
Local Environment: Validation fails for a 32-character hash.
Test Server: Validation passes for a 32-character hash, which matches the expected behavior.
Part of Dockerfile with installing Phalcon for local:
I have confirmed that the source code in both environments is the same. This behavior difference suggests a possible environment-specific issue or bug in the Max validator logic for the StringLength validator.
Details for both environments
Phalcon version: (5.7.0)
PHP Version: (8.3.13)
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm encountering a discrepancy in the behavior of the StringLength validator between my local environment and my test server.
It seems that on the local environment, the validation fails when strlen() >= max, while on the test server, it fails when strlen() > max (with includedMaximum set to false).
To Reproduce
Expected Behavior:
Since "includedMaximum" is false, validation should pass for strings with up to 32 characters and fail for 33 characters, according to the source code.
Observed Behavior:
Local Environment: Validation fails for a 32-character hash.
Test Server: Validation passes for a 32-character hash, which matches the expected behavior.
Part of Dockerfile with installing Phalcon for local:
Part of source code of Max.zep from docker:
I have confirmed that the source code in both environments is the same. This behavior difference suggests a possible environment-specific issue or bug in the Max validator logic for the StringLength validator.
Details for both environments
5.7.0
)8.3.13
)The text was updated successfully, but these errors were encountered: