Skip to content

Fully normalize template names in FilesystemLoader - #5044

Open
nicolas-grekas wants to merge 1 commit into
twigphp:3.xfrom
nicolas-grekas:filesystem-loader-name-spellings
Open

nicolas-grekas wants to merge 1 commit into
twigphp:3.xfrom
nicolas-grekas:filesystem-loader-name-spellings

Conversation

@nicolas-grekas

Copy link
Copy Markdown
Contributor

Follows #4985, which normalized backslashes and repeated slashes. Leading slashes, . and .. segments and the @__main__ prefix also load the same compiled template as the canonical name. Until now, the name of the template and _self depended on the spelling used to load it first.

.. segments are now resolved before looking up the file, so a/../x loads x even when a is a symlink or doesn't exist.

Leading slashes, `.` and `..` segments, and the `@__main__` prefix load the same compiled template as the canonical name. But the `Source` kept them as passed, so the name of the template and `_self` depended on the spelling used to load it first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant