const fix for usage with comparison operators (#618)

Fixes #609 #613
This commit is contained in:
Libor M
2021-01-05 22:07:44 +01:00
committed by GitHub
parent c295786e43
commit 820782cd80

View File

@@ -94,9 +94,9 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
break; break;
} }
if (strpos($_index[ 1 ], '$') === false && strpos($_index[ 1 ], '\'') === false) { if (strpos($_index[ 1 ], '$') === false && strpos($_index[ 1 ], '\'') === false) {
return "defined('{$_index[1]}') ? constant('{$_index[1]}') : null"; return "(defined('{$_index[1]}') ? constant('{$_index[1]}') : null)";
} else { } else {
return "defined({$_index[1]}) ? constant({$_index[1]}) : null"; return "(defined({$_index[1]}) ? constant({$_index[1]}) : null)";
} }
// no break // no break
case 'config': case 'config':