Skip to content

Commit

Permalink
fix(27098): add array unique to remove duplicate id param
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurujai committed Oct 17, 2024
1 parent a7efdf6 commit 2543b93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function generateURL(array $link_params, string $mm_id, string $url1): string
'hash' => filter_create_ticket($mm_id, $email ?: '', parse_url($url1, PHP_URL_HOST)),
];

$finalURL = $url1.'?'.http_build_query(array_merge($extra_arguments, $link_params));
$finalURL = $url1.'?'.http_build_query(array_unique(array_merge($extra_arguments, $link_params)));
return checkAndValidateURL($finalURL);
}

Expand Down Expand Up @@ -284,8 +284,7 @@ function checkAndValidateURL(string $url): string
return $url;
}

$finalURL = preg_replace('/\?hash=/', '&hash=', $url);
return preg_replace('/&id=[^&]+/', '', $finalURL);
return preg_replace('/\?hash=/', '&hash=', $url);
}

function getIframeWidth(string $isMultiStream): string
Expand All @@ -308,4 +307,4 @@ function getIframeHeight(string $isMultiStream): string
}

return $CFG->iframe_singlevideo_height ?: '333px';
}
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

defined('MOODLE_INTERNAL') || exit();

$plugin->version = 2024101701;
$plugin->version = 2024101704;
$plugin->requires = 2016112900;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'filter_pumukitmedia';
Expand Down

0 comments on commit 2543b93

Please sign in to comment.