Skip to content

Commit ce07899

Browse files
committed
fix(formanswer): php warning
1 parent d630302 commit ce07899

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

inc/formanswer.class.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -1404,9 +1404,10 @@ protected function validateFormAnswer($input): bool {
14041404
continue;
14051405
}
14061406
// Count the errors in session
1407-
$errors_count = $_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR]
1408-
? count($_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR])
1409-
: 0;
1407+
$errors_count = 0;
1408+
if (isset($_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR])) {
1409+
$errors_count = count($_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR]);
1410+
}
14101411
if (PluginFormcreatorFields::isVisible($field->getQuestion(), $this->questionFields) && !$this->questionFields[$id]->isValid()) {
14111412
$new_errors_count = $_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR]
14121413
? count($_SESSION['MESSAGE_AFTER_REDIRECT'][ERROR])

0 commit comments

Comments
 (0)