Fix warning when calling hasVariable for an undefined variable

Fixes #977
This commit is contained in:
Simon Wisselink
2024-03-29 22:36:30 +01:00
parent bbd09c7bfa
commit 27e5768e31
2 changed files with 2 additions and 1 deletions

1
changelog/977.md Normal file
View File

@@ -0,0 +1 @@
- Fix warning when calling hasVariable for an undefined variable [#977](https://github.com/smarty-php/smarty/issues/977)

View File

@@ -290,7 +290,7 @@ class Data
* @return bool
*/
public function hasVariable($varName): bool {
return !($this->getVariable($varName) instanceof UndefinedVariable);
return !($this->getVariable($varName, true, false) instanceof UndefinedVariable);
}
/**