You are here

public function NoReferrerSettingsForm::publish in No Referrer 8

Publishes domain whitelist.

1 call to NoReferrerSettingsForm::publish()
NoReferrerSettingsForm::submitForm in src/Form/NoReferrerSettingsForm.php
Form submission handler.

File

src/Form/NoReferrerSettingsForm.php, line 138

Class

NoReferrerSettingsForm
Implements a noreferrer Config form.

Namespace

Drupal\noreferrer\Form

Code

public function publish() {
  if ($whitelist = $this
    ->config('noreferrer.settings')
    ->get('whitelisted_domains')) {
    $whitelist = json_encode(explode(' ', $whitelist));
    $this->fileSystem
      ->saveData($whitelist, $this
      ->publishUri(), FileSystemInterface::EXISTS_REPLACE);
  }
}