-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Infinite recursion sanity checks with more helpful error messages #214
Bugfix: Infinite recursion sanity checks with more helpful error messages #214
Conversation
Adds sanity checks to prevent unanticipated internal infinite recursions (now throws Exceptions with helpful messages; previously timed out or hit memory limits)
4bb4641
to
88676bf
Compare
Extracted some duplicate code to satisfy previously failed workflow |
Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
…silverstripe#214) * Infinite recursion protections Adds sanity checks to prevent unanticipated internal infinite recursions (now throws Exceptions with helpful messages; previously timed out or hit memory limits) * Accepting coding standards Co-authored-by: Steve Boyd <emteknetnz@gmail.com> * MNT Linting --------- Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
I've merged this, though I noticed that it was targetting the I've created a backport PR to get this into |
Thanks for all your work to get this across the finish line, @emteknetnz! |
Issue #213
The following snippet in
ShareDraftController.php
at L161 includes no sanity checks to prevent infinite recursions when it attempts to follow redirects internally via recursions.silverstripe-sharedraftcontent/src/Controllers/ShareDraftController.php
Lines 137 to 165 in 7c3f7e7
Infinite recursions, such as those experienced in #213, would previously cause fatal time out or memory limit errors.
This pull request resolves this problem by adding sanity checks, preventing unanticipated internal infinite recursions via "logging" a minimal redirect stack to a private array on
ShareDraftController
and throws an Exception (with helpful information for developers) if....(30 is an arbitrary number that seems to be more than what is typically necessary; this could, in a separate PR, be pulled into a config variable if desired)
Examples of Exception outputs
Infinite recursion detected
Max redirect recursions reached
Related
Info
2
and can be rebased onto3
without issue@muskie9