Skip to content

Commit 1bc5beb

Browse files
authored
[5.3] Catch undefined cors options when saving global options (#45103)
1 parent 8cad920 commit 1bc5beb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

administrator/components/com_config/src/Model/ApplicationModel.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,10 @@ public function save($data)
745745
$config = new Registry($data);
746746

747747
// Overwrite webservices cors settings
748-
$app->set('cors', $data['cors']);
749-
$app->set('cors_allow_origin', $data['cors_allow_origin']);
750-
$app->set('cors_allow_headers', $data['cors_allow_headers']);
751-
$app->set('cors_allow_methods', $data['cors_allow_methods']);
748+
$app->set('cors', $data['cors'] ?? 0);
749+
$app->set('cors_allow_origin', $data['cors_allow_origin'] ?? '*');
750+
$app->set('cors_allow_headers', $data['cors_allow_headers'] ?? 'Content-Type,X-Joomla-Token');
751+
$app->set('cors_allow_methods', $data['cors_allow_methods'] ?? '');
752752

753753
// Clear cache of com_config component.
754754
$this->cleanCache('_system');

0 commit comments

Comments
 (0)