public function TrustedHostSettings::buildForm in Security Review 8
Form constructor.
Return value
array The form structure.
Overrides CheckSettings::buildForm
File
- src/
CheckSettings/ TrustedHostSettings.php, line 15
Class
- TrustedHostSettings
- Provides the settings form for the TrustedHosts check.
Namespace
Drupal\security_review\CheckSettingsCode
public function buildForm() {
$form = [];
$form['method'] = [
'#type' => 'radios',
'#title' => t('Check method'),
'#description' => t('Detecting the $base_url in settings.php can be done via PHP tokenization (recommended) or including the file. Note that if you have custom functionality in your settings.php it will be executed if the file is included. Including the file can result in a more accurate $base_url check if you wrap the setting in conditional statements.'),
'#options' => [
'token' => t('Tokenize settings.php (recommended)'),
'include' => t('Include settings.php'),
],
'#default_value' => $this
->get('method', 'token'),
];
return $form;
}