Bug #29457

Template Compiler creates invalid Class names

Added by Bastian Waidelich almost 4 years ago. Updated almost 4 years ago.

Status:Resolved Start date:2011-09-02
Priority:Must have Due date:
Assigned To:- % Done:

100%

Category:Core
Target version:TYPO3 Flow Base Distribution - 1.0 beta 2
Has patch:No Affected Flow version:

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!

Associated revisions

Revision 8762cd91
Added by Bastian Waidelich almost 4 years ago

[BUGFIX] Sanitize identifier when compiling templates

The "identifier" of a compiled template is based on the
last modification timestamp and on the name of the original
template/partial/layout.
if that name contains special characters (like dashes),
the class name of the compiled template is invalid
resulting in a fatal error.
This is fixed by sanitizing the identifier before creating
the compiled template.

Change-Id: I89eb9fae476d7e642618639f56d401158f69f7e8
Resolves: #29457

History

#1 Updated by Bastian Waidelich almost 4 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 almost 4 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 almost 4 years ago

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

Also available in: Atom PDF