-
Notifications
You must be signed in to change notification settings - Fork 709
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
modifier default not working with @ suppression #336
Comments
Is it possible to get rid of suppression in 'default'? |
1 similar comment
Is it possible to get rid of suppression in 'default'? |
Had the same issue when debuging, I had a lots of notices in the console. Plus a possible performance loss from the notice being issued ( https://stackoverflow.com/questions/1868874/does-php-run-faster-without-warnings ) Maybe it's worth changing the original function?
|
@Miksser @antman3351 I've added an empty check for variables for |
I just had a quick look at the change, so I might have missed something, but doesn't this change the behaviour of the default modifier? |
Well spotted, @antman3351 ! Not sure how that got past me. I thought I ran the new unit tests against the old code (seeing no change in behavior) but I must have somehow messed that up. |
The default modifier has already been changed to longer use the @ modifier in #629 |
The default modifier just access the tpl_vars array with the non existing key and tries to suppress the error outcome with '@' like:
$tmp = @$_smarty_tpl->tpl_vars['bShowInfo']->value
This won't work in PHP >= 5.4 (5.3 as well?)
There should be at least an "array_key_exist | isset" check to get the functionality right
The text was updated successfully, but these errors were encountered: