Skip to content

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

Merged
wisskid merged 1 commit intosmarty-php:masterfrom
Jack-Dane:master
Oct 22, 2023
Merged

Fix case-sensitive tag names (#907)#910
wisskid merged 1 commit intosmarty-php:masterfrom
Jack-Dane:master

Conversation

@Jack-Dane
Copy link
Copy Markdown
Contributor

@Jack-Dane Jack-Dane commented Oct 1, 2023

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.

* Don't lower tags until they are used for extensions so custom tags can be case-sensitive.
@wisskid
Copy link
Copy Markdown
Member

wisskid commented Oct 22, 2023

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

@wisskid wisskid merged commit 212bf88 into smarty-php:master Oct 22, 2023
wisskid pushed a commit that referenced this pull request Nov 6, 2023
* Don't lower tags until they are used for extensions so custom tags can be case-sensitive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smarty 5: registerPlugin() no longer working with names containing non-lowercase characters

2 participants