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

!empty not working on PHP 5.3.28/29 | Compatible? #460

Closed
richardeth opened this issue Jul 13, 2018 · 1 comment
Closed

!empty not working on PHP 5.3.28/29 | Compatible? #460

richardeth opened this issue Jul 13, 2018 · 1 comment

Comments

@richardeth
Copy link

richardeth commented Jul 13, 2018

Compiler create a !empty($variable) to if (!($variable === false) which is true on an "" empty string.

I'm not sure if this is the best way but fixed it for me. Composer says it's PHP 5.2+ but it isn't?

file: smarty_internal_templatecompilerbase.ph

line 589:

if ($parHasFuction && version_compare(PHP_VERSION, '5.5.0', '<')) {

I added

if ($parHasFuction && version_compare(PHP_VERSION, '5.4.0', '<')) { //custom
    return $func_name . '(' . $parameter[ 0 ] . ')';  //custom
} else 

So it looks like this

if ($parHasFuction && version_compare(PHP_VERSION, '5.4.0', '<')) { //custom
    return $func_name . '(' . $parameter[ 0 ] . ')';  //custom
} else if ($parHasFuction && version_compare(PHP_VERSION, '5.5.0', '<')) {
@wisskid
Copy link
Contributor

wisskid commented Jan 28, 2020

This is very much related to #453 and will be fixed in #567

@wisskid wisskid closed this as completed Jan 28, 2020
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

No branches or pull requests

2 participants