mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
UnitOfWork does not distinguish between empty string or boolean false when hashing identifiers #5178
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ocramius on GitHub (Jul 7, 2016).
Specifically, when new entities are registered in the identity map, no type information is maintained inside the hashed identifier.
This makes the code quite fragile, and allows for ugly edge-case scenarios:
trueand1,falseand'')A solution would be to store type information (about the identifier) into the generated hash. This can easily be done with
json_encode(), for example (note that it would be incompatible with object identifier values), or byarray_map()-ing over the values (slow: potentially a performance killer).