bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!
2.66k stars 446 forks source link

Extend template error #1268

Open sfarleandro opened 1 year ago

sfarleandro commented 1 year ago

Hello

My custom tags (extended templates) stoped working after upgrade to 3.8.x. Sample example:

index.html:

index.php \Template::instance()->extend('CustomTag', function(){

echo 'Custom Tag rendered';

});

\Template::instance()->render('index.html');

Error: Internal Server Error

Undefined array key "_customtag"

I found a change on line 302 of file template.php: $node=&$tree[][strtolower($match[3])];

Old version $node=&$tree[][$match[3]];

The new version (with strtolower) generate undefined array key error (PHP 8.0)