zendframework / zend-session

Manage and preserve session data, a logical complement of cookie data, across multiple page requests by the same client.
BSD 3-Clause "New" or "Revised" License
42 stars 64 forks source link

Properly merge arrays of allowed hash algorithms. #123

Closed TysonAndre closed 4 years ago

TysonAndre commented 4 years ago

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:

michalbundyra commented 4 years ago

Thanks, @TysonAndre!