Skip to content

Commit

Permalink
fix(formanswer): php warning
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jun 14, 2023
1 parent d630302 commit ce07899
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions inc/formanswer.class.php
Expand Up @@ -1404,9 +1404,10 @@ protected function validateFormAnswer($input): bool {
continue;
}
// Count the errors in session
$errors_count = $_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR]
? count($_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR])
: 0;
$errors_count = 0;
if (isset($_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR])) {
$errors_count = count($_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR]);
}
if (PluginFormcreatorFields::isVisible($field->getQuestion(), $this->questionFields) && !$this->questionFields[$id]->isValid()) {
$new_errors_count = $_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR]
? count($_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR])
Expand Down

0 comments on commit ce07899

Please sign in to comment.