Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix \yii\filters\Cors::actions when attached to a module #20230

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Yii Framework 2 Change Log
- Bug #20211: Add acceptable parameters to `MaskedInput::init()` method (alxlnk)
- Bug #20226: Revert all PR for "Data providers perform unnecessary COUNT queries that negatively affect performance" (@terabytesoftw)
- Bug #20147: Fix error handler compatibility with PHP 8.3 (samdark)
- Bug #20230: Fix getting ID in `\yii\filters\Cors::actions()` when attached to a module (timkelty)


2.0.50 May 30, 2024
Expand Down
6 changes: 4 additions & 2 deletions framework/filters/Cors.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ public function beforeAction($action)
*/
public function overrideDefaultSettings($action)
{
if (isset($this->actions[$action->id])) {
$actionParams = $this->actions[$action->id];
$actionId = $this->getActionId($action);

if (isset($this->actions[$actionId])) {
$actionParams = $this->actions[$actionId];
$actionParamsKeys = array_keys($actionParams);
foreach ($this->cors as $headerField => $headerValue) {
if (in_array($headerField, $actionParamsKeys)) {
Expand Down
Loading