diff options
Diffstat (limited to 'lib/classes/forms/Form.php')
| -rw-r--r-- | lib/classes/forms/Form.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/classes/forms/Form.php b/lib/classes/forms/Form.php index f34b68d..58ff72d 100644 --- a/lib/classes/forms/Form.php +++ b/lib/classes/forms/Form.php @@ -314,7 +314,7 @@ class Form extends Part return $this; } - public function validate() + public function validate(bool $return = false) { if (\Request::isPost() && \Request::submitted('STUDIPFORM_SERVERVALIDATION')) { //verify the user input: @@ -333,10 +333,14 @@ class Form extends Part } } } - header('Content-Type: application/json'); - echo json_encode($output); sess()->save(); - die(); + if ($return) { + return $output; + } else { + header('Content-Type: application/json'); + echo json_encode($output); + die(); + } } return $this; } |
