Skip to content

Commit 13e643d

Browse files
committed
Form::initialize() ignores cli/phpdbg/embed
1 parent 2358e5c commit 13e643d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Forms/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ public static function initialize(bool $reinit = false): void
740740

741741
self::$defaultHttpRequest = (new Nette\Http\RequestFactory)->fromGlobals();
742742

743-
if (PHP_SAPI !== 'cli') {
743+
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
744744
if (headers_sent($file, $line)) {
745745
throw new Nette\InvalidStateException(
746746
'Create a form or call Nette\Forms\Form::initialize() before the headers are sent to initialize CSRF protection.'

0 commit comments

Comments
 (0)