Skip to content

Commit

Permalink
Delete CORS domain always as asked
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Dec 1, 2017
1 parent 20ebcea commit 5e9412b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions settings/Controller/CorsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,11 @@ public function addDomain($domain) {
public function removeDomain($id) {
$userId = $this->userId;
$domains = json_decode($this->config->getUserValue($userId, 'core', 'domains'), true);
if ($id >= 0 && $id < count($domains)) {
unset($domains[$id]);
if (count($domains)) {
$this->config->setUserValue($userId, 'core', 'domains', json_encode($domains));
} else {
$this->config->deleteUserValue($userId, 'core', 'domains');
}
unset($domains[$id]);
if (count($domains)) {
$this->config->setUserValue($userId, 'core', 'domains', json_encode($domains));
} else {
$this->config->deleteUserValue($userId, 'core', 'domains');
}

return $this->getRedirectResponse();
Expand Down

0 comments on commit 5e9412b

Please sign in to comment.