mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1598: ProxyFactory makes assumptions on identifier getter code #2003
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 @doctrinebot on GitHub (Jan 13, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user @ocramius:
As of
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L214
and
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L237
the current ProxyFactory isn't actually checking if the identifier getter has logic in it.
Current checks aren't enough/valid.
In my opinion the check should be matching following:
(public|protected)\sfunction\sgetFieldname\s**(\s_)\s+{\s_$this\s_->Fieldname\s_;\s**}
Not really experienced with regex, but currently cannot come up with a more secure check.