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

Removes unused method Proxy\Controller::isPiwikUrl() #19610

Merged
merged 1 commit into from Aug 8, 2022
Merged

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Aug 8, 2022

Description:

While checking some other issue I cam across this unused method.

We used to use that method when we had a redirect method in the Proxy plugin to hide the referrer. With it's removal the method isn't used anymore.

public function redirect()
{
$url = Common::getRequestVar('url', '', 'string', $_GET);
if (!UrlHelper::isLookLikeUrl($url)) {
die('Please check the &url= parameter: it should to be a valid URL');
}
// validate referrer
$referrer = Url::getReferrer();
if (empty($referrer) || !Url::isLocalUrl($referrer)) {
die('Invalid Referrer detected - This means that your web browser is not sending the "Referrer URL" which is
required to proceed with the redirect. Verify your browser settings and add-ons, to check why your browser
is not sending this referrer.
<br/><br/>You can access the page at: ' . $url);
}
// mask visits to *.piwik.org
if (!self::isPiwikUrl($url)) {
Piwik::checkUserHasSomeViewAccess();
}
Common::sendHeader('Content-Type: text/html; charset=utf-8');
echo '<html><head><meta http-equiv="refresh" content="0;url=' . $url . '" /></head></html>';
exit;
}

Review

@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Aug 8, 2022
@sgiehl sgiehl added this to the 4.12.0 milestone Aug 8, 2022
@sgiehl sgiehl requested a review from bx80 August 8, 2022 15:42
Copy link
Contributor

@bx80 bx80 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked that the method isn't used anywhere in the codebase. Proxy unit test complete successfully.

@bx80 bx80 merged commit 48c458c into 4.x-dev Aug 8, 2022
@bx80 bx80 deleted the unusedproxymethod branch August 8, 2022 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants