Skip to content

Commit

Permalink
Fix #20230: Fix getting ID in \yii\filters\Cors::actions() when att…
Browse files Browse the repository at this point in the history
…ached to a module
  • Loading branch information
timkelty authored Jul 18, 2024
1 parent 4b0a02e commit de2e5ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit de2e5ea

Please sign in to comment.