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

Properly merge arrays of allowed hash algorithms. #123

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

TysonAndre
Copy link
Contributor

@TysonAndre TysonAndre commented Oct 18, 2019

The + operator does not renumber array keys.
The keys that existed on the left side will replace fields from the
right hand side with the same keys.

On my installation, md2 and md4 would left out of the final result.

This was detected by static analysis (Phan dev-master). I don't have a personal use case
for md2/md4.

php > echo count(array_merge([0,1], hash_algos()));
54
php > echo count([0,1] + hash_algos());
52

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. (md2 and md4 aren't allowed hashes for SessionConfig->setHashFunction, probably unintentionally)
    • Detail the new, expected behavior. (md2/md4 are allowed)
    • 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.
  • Are you creating a new feature?

    • Why is the new feature needed? What purpose does it serve?
    • How will users use the new feature?
    • Base your feature on the develop branch, and submit against that branch.
    • Add only one feature per pull request; split multiple features over multiple pull requests
    • Add tests for the new feature.
    • Add documentation for the new feature.
    • Add a CHANGELOG.md entry for the new feature.
  • Is this related to quality assurance?

  • Is this related to documentation?

The `+` operator does not renumber array keys.
The keys that existed on the left side will replace fields from the
right hand side with the same keys.

On my installation, `md2` and `md4` would left out of the final result.

This was detected by static analysis. I don't have a personal use case
for md2/md4.
@michalbundyra michalbundyra added this to the 2.9.1 milestone Oct 18, 2019
@michalbundyra
Copy link
Member

Thanks, @TysonAndre!

michalbundyra added a commit that referenced this pull request Oct 28, 2019
Properly merge arrays of allowed hash algorithms.
michalbundyra added a commit that referenced this pull request Oct 28, 2019
michalbundyra added a commit that referenced this pull request Oct 28, 2019
@michalbundyra michalbundyra merged commit fd7c9ad into zendframework:master Oct 28, 2019
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.

3 participants