diff --git a/src/Control/CLIRequestBuilder.php b/src/Control/CLIRequestBuilder.php index 006dc7ab6..e122288d5 100644 --- a/src/Control/CLIRequestBuilder.php +++ b/src/Control/CLIRequestBuilder.php @@ -64,6 +64,13 @@ class CLIRequestBuilder extends HTTPRequestBuilder $variables['_GET']['url'] = $variables['_SERVER']['argv'][1]; $variables['_SERVER']['REQUEST_URI'] = $variables['_SERVER']['argv'][1]; } + + // Set 'HTTPS' and 'SSL' flag for CLI depending on SS_BASE_URL scheme value. + $scheme = parse_url(Environment::getEnv('SS_BASE_URL') ?? '', PHP_URL_SCHEME); + if ($scheme == 'https') { + $variables['_SERVER']['HTTPS'] = 'on'; + $variables['_SERVER']['SSL'] = true; + } // Parse rest of variables as standard return parent::cleanEnvironment($variables); diff --git a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php index af245ad26..fef944f0c 100644 --- a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php +++ b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php @@ -587,7 +587,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler /** * Get the current paginator state */ - private function getGridFieldPaginatorState(): GridState_Data + private function getGridFieldPaginatorState(): ?GridState_Data { $state = $this->getGridField()->getState(false); $gridStateStr = $this->getStateManager()->getStateFromRequest($this->gridField, $this->getRequest()); diff --git a/src/Security/PermissionCheckboxSetField.php b/src/Security/PermissionCheckboxSetField.php index fde5ad178..51fa3ff06 100644 --- a/src/Security/PermissionCheckboxSetField.php +++ b/src/Security/PermissionCheckboxSetField.php @@ -207,7 +207,7 @@ class PermissionCheckboxSetField extends FormField $odd = ($odd + 1) % 2; $extraClass = $odd ? 'odd' : 'even'; - $extraClass .= ' val' . str_replace(' ', '', $code ?? ''); + $extraClass .= ' val' . str_replace([' ', '\\'], ['', '-'], $code ?? ''); $itemID = $this->ID() . '_' . preg_replace('/[^a-zA-Z0-9]+/', '', $code ?? ''); $disabled = $inheritMessage = ''; $checked = (isset($uninheritedCodes[$code]) || isset($inheritedCodes[$code]))