Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #2701 Ensure that syntax errors are triggered with the right line…
… (stof) This PR was merged into the 1.x branch. Discussion ---------- Ensure that syntax errors are triggered with the right line When throwing the syntax error without any line and source in these places, the guessing logic enters into action. For the main template, it won't find anything. But for included templates (or any other template loaded during the rendering of another one, even as main one), the guessing will find a template (the caller one) and set the source and line based on it. The source will then be replaced by the proper template by `\Twig_Environment::compileSource`, but the guessed line number will make no sense then. I searched for all places triggering a syntax error in Twig, to ensure that they always set the actual line number or set the source directly (so that the guessing logic knows that the template it found is the wrong one and so does not try to use it for guessing). There were only a few missing ones. Commits ------- 6fab6b0 Ensure that syntax errors are triggered with the right line
- Loading branch information