Skip to content

Commit 224a853

Browse files
authored
PES-2741: restricted request parsing to non-CLI environments (#775)
2 parents 3c93d07 + da99c6d commit 224a853

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

bootstrap.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
require_once __DIR__ . '/deps/scoper-autoload.php';
1818

1919
$disableGetPostCookieParsing = false;
20-
try {
21-
( new RequestFactory() )->fromGlobals();
22-
} catch ( InvalidStateException $invalidStateException ) {
23-
$disableGetPostCookieParsing = true;
20+
if ( PHP_SAPI !== 'cli' ) {
21+
try {
22+
( new RequestFactory() )->fromGlobals();
23+
} catch ( InvalidStateException $invalidStateException ) {
24+
$disableGetPostCookieParsing = true;
25+
}
2426
}
2527

2628
$configurator = new Configurator();

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
== Changelog ==
22
= 2.0.3 =
33
Added: Added taxes settings to options export.
4+
Fixed: Resolved error occuring when running in CLI environment.
45

56
= 2.0.2 =
67
Fixed: Fixed wp-cli compatibility issue.

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Please contact us at [email protected] .
6464
== Changelog ==
6565
= 2.0.3 =
6666
Added: Added taxes settings to options export.
67+
Fixed: Resolved error occuring when running in CLI environment.
6768

6869
= 2.0.2 =
6970
Fixed: Fixed wp-cli compatibility issue.

0 commit comments

Comments
 (0)