Bug #29457

Template Compiler creates invalid Class names

Added by Bastian Waidelich over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Core
Start date:
2011-09-02
Due date:
% Done:

100%

Estimated time:
Has patch:
No

Description

The "identifier" of a compiled template is based on the last modification timestamp and on the name of the original template/partial/layout.
In Core/Compiler/TemplateCompiler::store() this identifier is used as part of the class name for the compiled template without sanitizing the string first. This leads to invalid class names (= fatal error) if the identifier contains (for example) a dash.

Note: This also affects v4 and needs to be backported!

#1

Updated by Bastian Waidelich over 10 years ago

See also http://www.php.net/manual/en/language.variables.basics.php:

Variable names follow the same rules as other labels in PHP [...]
As a regular expression, it would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'

#2

Updated by Mr. Hudson over 10 years ago

Patch set 1 of change I89eb9fae476d7e642618639f56d401158f69f7e8 has been pushed to the review server.
It is available at http://review.typo3.org/4790

#3

Updated by Bastian Waidelich over 10 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF