diff --git a/src/TaskRunner/Commands/DrupalCommands.php b/src/TaskRunner/Commands/DrupalCommands.php index 3d3b98e1e..e3ef8588c 100644 --- a/src/TaskRunner/Commands/DrupalCommands.php +++ b/src/TaskRunner/Commands/DrupalCommands.php @@ -620,8 +620,8 @@ protected function getToolkitSettingsBlock() \$settings['file_temp_path'] = getenv('DRUPAL_FILE_TEMP_PATH') !== FALSE ? getenv('DRUPAL_FILE_TEMP_PATH') : '/tmp'; // Reverse proxy. -if (intval(getenv('DRUPAL_REVERSE_PROXY_ENABLE')) === 1) { - \$settings['reverse_proxy'] = (bool) getenv('DRUPAL_REVERSE_PROXY_ENABLE'); +if (filter_var(getenv('DRUPAL_REVERSE_PROXY_ENABLE'), FILTER_VALIDATE_BOOLEAN)) { + \$settings['reverse_proxy'] = getenv('DRUPAL_REVERSE_PROXY_ENABLE'); \$settings['reverse_proxy_addresses'] = explode(',', getenv('DRUPAL_REVERSE_PROXY_ADDRESSES')); } diff --git a/tests/fixtures/commands/drupal-settings-setup.yml b/tests/fixtures/commands/drupal-settings-setup.yml index 04dd76e26..11a2c17a5 100644 --- a/tests/fixtures/commands/drupal-settings-setup.yml +++ b/tests/fixtures/commands/drupal-settings-setup.yml @@ -40,8 +40,8 @@ $settings['file_temp_path'] = getenv('DRUPAL_FILE_TEMP_PATH') !== FALSE ? getenv('DRUPAL_FILE_TEMP_PATH') : '/tmp'; // Reverse proxy. - if (intval(getenv('DRUPAL_REVERSE_PROXY_ENABLE')) === 1) { - $settings['reverse_proxy'] = (bool) getenv('DRUPAL_REVERSE_PROXY_ENABLE'); + if (filter_var(getenv('DRUPAL_REVERSE_PROXY_ENABLE'), FILTER_VALIDATE_BOOLEAN)) { + $settings['reverse_proxy'] = getenv('DRUPAL_REVERSE_PROXY_ENABLE'); $settings['reverse_proxy_addresses'] = explode(',', getenv('DRUPAL_REVERSE_PROXY_ADDRESSES')); } @@ -103,8 +103,8 @@ $settings['file_temp_path'] = getenv('DRUPAL_FILE_TEMP_PATH') !== FALSE ? getenv('DRUPAL_FILE_TEMP_PATH') : '/tmp'; // Reverse proxy. - if (intval(getenv('DRUPAL_REVERSE_PROXY_ENABLE')) === 1) { - $settings['reverse_proxy'] = (bool) getenv('DRUPAL_REVERSE_PROXY_ENABLE'); + if (filter_var(getenv('DRUPAL_REVERSE_PROXY_ENABLE'), FILTER_VALIDATE_BOOLEAN)) { + $settings['reverse_proxy'] = getenv('DRUPAL_REVERSE_PROXY_ENABLE'); $settings['reverse_proxy_addresses'] = explode(',', getenv('DRUPAL_REVERSE_PROXY_ADDRESSES')); } @@ -167,8 +167,8 @@ $settings['file_temp_path'] = getenv('DRUPAL_FILE_TEMP_PATH') !== FALSE ? getenv('DRUPAL_FILE_TEMP_PATH') : '/tmp'; // Reverse proxy. - if (intval(getenv('DRUPAL_REVERSE_PROXY_ENABLE')) === 1) { - $settings['reverse_proxy'] = (bool) getenv('DRUPAL_REVERSE_PROXY_ENABLE'); + if (filter_var(getenv('DRUPAL_REVERSE_PROXY_ENABLE'), FILTER_VALIDATE_BOOLEAN)) { + $settings['reverse_proxy'] = getenv('DRUPAL_REVERSE_PROXY_ENABLE'); $settings['reverse_proxy_addresses'] = explode(',', getenv('DRUPAL_REVERSE_PROXY_ADDRESSES')); }