Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Oct 22, 2023
Merged

Conversation

Jack-Dane
Copy link
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
Contributor

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
9 checks passed
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