Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Fixes File\Hash validator to work with digit-only hashes and match algo #277

Merged
merged 1 commit into from
Oct 29, 2019
Merged

Fixes File\Hash validator to work with digit-only hashes and match algo #277

merged 1 commit into from
Oct 29, 2019

Conversation

michalbundyra
Copy link
Member

Validation was failing when file hash was digit-only due to issue with the implementation and silent type conversion when using array_keys on array with digit-only string keys.

Also fixed other issue, where hash was not checked against the algorithm.

Fixes #276

Provide a narrative description of what you are trying to accomplish:

  • Are you fixing a bug?
    • Detail how the bug is invoked currently.
    • Detail the original, incorrect behavior.
    • Detail the new, expected behavior.
    • Base your feature on the master branch, and submit against that branch.
    • Add a regression test that demonstrates the bug, and proves the fix.
    • Add a CHANGELOG.md entry for the fix.

Validation was failing when file hash was digit-only due to issue with
the implementation and silent type conversion when using array_keys
on array with digit-only string keys.

Also fixed other issue, where hash was not checked against the algorithm.

Fixes #276
Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. 🚢

@froschdesign
Copy link
Member

@webimpress
The failure is not related to this PR:

1) ZendTest\Validator\EmailAddressTest::testNoMxRecordARecordFallback
Email host contains MX records
Failed asserting that true is false.
/home/travis/build/zendframework/zend-validator/test/EmailAddressTest.php:404

https://travis-ci.org/zendframework/zend-validator/jobs/604109135#L428

Copy link
Member

@froschdesign froschdesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@michalbundyra
Copy link
Member Author

@froschdesign

The failure is not related to this PR

Yes, I've seen it before, it looks like example.com domain has now defined some MX records, but before it hasn't. Because of that some tests are failing. We need to sort it out somehow - maybe our custom subdomain without mx records?

michalbundyra added a commit that referenced this pull request Oct 29, 2019
Fixes File\Hash validator to work with digit-only hashes and match algo
michalbundyra added a commit that referenced this pull request Oct 29, 2019
michalbundyra added a commit that referenced this pull request Oct 29, 2019
@michalbundyra michalbundyra merged commit 40a1976 into zendframework:master Oct 29, 2019
michalbundyra added a commit that referenced this pull request Oct 29, 2019
@michalbundyra michalbundyra deleted the hotfix/hash-validator branch October 29, 2019 08:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hash and Crc32 validator issue if hash has only digits
3 participants