Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions libraries/src/Application/ApiApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,26 @@ protected function route()
throw $e;
}

$this->input->set('option', $route['vars']['component']);
$this->input->set('controller', $route['controller']);
$this->input->set('task', $route['task']);

foreach ($route['vars'] as $key => $value) {
if ($key !== 'component') {
if ($this->input->getMethod() === 'POST') {
$this->input->post->set($key, $value);
} else {
$this->input->set($key, $value);
}
// We inject the format directly above based on the negotiated format. We do not want the array of possible
// formats provided by the plugin!
if ($key === 'format') {
continue;
}

// We inject the component key into the option parameter in global input for b/c with the other applications
if ($key === 'component') {
$this->input->set('option', $route['vars'][$key]);
continue;
}

if ($this->input->getMethod() === 'POST') {
$this->input->post->set($key, $value);
} else {
$this->input->set($key, $value);
}
}

Expand Down