Skip to content

Commit

Permalink
Fix warning when calling hasVariable for an undefined variable
Browse files Browse the repository at this point in the history
Fixes #977
  • Loading branch information
wisskid committed Mar 29, 2024
1 parent bbd09c7 commit 27e5768
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/977.md
@@ -0,0 +1 @@
- Fix warning when calling hasVariable for an undefined variable [#977](https://github.com/smarty-php/smarty/issues/977)
2 changes: 1 addition & 1 deletion src/Data.php
Expand Up @@ -290,7 +290,7 @@ public function setVariable($varName, Variable $variableObject) {
* @return bool
*/
public function hasVariable($varName): bool {
return !($this->getVariable($varName) instanceof UndefinedVariable);
return !($this->getVariable($varName, true, false) instanceof UndefinedVariable);
}

/**
Expand Down

0 comments on commit 27e5768

Please sign in to comment.