[1.x] fix(core): restore xdebug.max_nesting_level after less compilation
#4262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1.xequivalent to #4263Fixes #0000
In some environments, it's possible that a combination of multiple extensions / configs causes the
max_nesting_levelof to exceed 200, causing the following error:flarum.ERROR: Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '200'This is particularly an issue for local development where both Xdebug and Flarums debug mode is enabled, meaning the LessCompiler is hit on every request to the forum.
Changes proposed in this pull request:
This PR stores the current nesting level and resets it after less compliation is done.
Reviewers should focus on:
If
xdebug.max_nesting_levelis not set,ini_get()will return false. To address this I've wrapped the restoration to avoid setting this value tofalse.Screenshot
Necessity
Confirmed
composer test).Required changes: