-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix segfault on infinite recursion into circular model relations
In cases where related models were set before save on *both* sides of a hasMany/belongsTo relationship, `Model::save()` would go into an infinite loop as its pre and post-save checks for relations to save never checked if the related model had already been saved: Save A \_ A hasMany B \_ Save B \_ B belongsTo A \_ Save A \_ ... For me this was causing a segfault, though with xdebug installed it would error before crashing at the max_nesting_level.
- Loading branch information
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters