smarty-php / smarty

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic.
Other
2.24k stars 705 forks source link

Fix case-sensitive tag names (#907) #910

Closed Jack-Dane closed 10 months ago

Jack-Dane commented 11 months ago

This should fix #907.

All tests pass, I thought about adding more tests for various plugins but it seemed overkill, happy to add them if the reviewer thinks otherwise.

There might be a regression here (I don't think so) but just so everyone is aware this will start failing:

$smarty = new Smarty();
$smarty->registerPlugin(Smarty::PLUGIN_FUNCTION, 'customtag', [Functions::class, 'customTag']);
$smarty->display('string:{customTag}');

I have kept the "built-in" tags case-insensitive because they have been relying on them being lowercase, so I think it is sensible to keep it this way.

wisskid commented 10 months ago

Seems perfect @Jack-Dane ! The possible regression you are mentioning is not a regression: it also fails in Smarty v4.