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

Second Parameter for unescape modifier not working #777

Closed
attrib opened this issue Aug 1, 2022 · 2 comments · Fixed by #778
Closed

Second Parameter for unescape modifier not working #777

attrib opened this issue Aug 1, 2022 · 2 comments · Fixed by #778

Comments

@attrib
Copy link

attrib commented Aug 1, 2022

I'm not sure if I'm doing it just wrong or if there is a bug in the unescape modifier

What I'm trying is something like this

{$content|unescape:'htmlall':'utf-8'}

This results in:

<?php echo html_entity_decode($content, ENT_NOQUOTES, ''utf-8'');?>

Looking into the code, I see that there is $params[ 2 ] = "'{$params[ 2 ]}'"; - but somehow it is already in quotes.

For params[1] it does a trim for " and ' - why not for params[2]?

On a side note, even if I not using it, but I tested it now while debugging this issue:

{$content|unescape:'htmlall':$encoding}

results in

<?php echo html_entity_decode($content, ENT_NOQUOTES, '$encoding');?>

so its not working $encoding is inside single quote.

@attrib
Copy link
Author

attrib commented Aug 1, 2022

fyi: in my case I remove the utf-8 there as I didn't needed, but I thought I wanted to share this issue, if maybe somebody else stumbled across this.

@wisskid
Copy link
Contributor

wisskid commented Aug 1, 2022

Definitely sounds like a bug to me! I'll look into it.

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 a pull request may close this issue.

2 participants