Don't use HTTP_REFERER for Dummy_Request to prevent (logged) exceptions.#1234
Open
possi wants to merge 1 commit intonexcess:develfrom
Open
Don't use HTTP_REFERER for Dummy_Request to prevent (logged) exceptions.#1234possi wants to merge 1 commit intonexcess:develfrom
possi wants to merge 1 commit intonexcess:develfrom
Conversation
Contributor
|
Have you seen #1235? It seems to be pretty similar to this, thoughts? |
Contributor
Author
|
Indeed. But my approach fixes the root-cause instead of just silently catch the exception. |
Contributor
|
@magedev thoughts? |
Contributor
|
Looks good (did not test) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scenario to create an Invalid Dummy-Request-Url (which throws an exception in Debug-Mode):
0. Assume a global, public ESI-Block on page (e.g. "menu")
Disabling the debug mode suppresses the exception, but spams the logs.
Reason:
For global blocks no /r64/.../-Param is passed to the ESI-Url. Mage_Core_Controller_Varien_Action::_getRefererUrl() uses $_SERVER['HTTP_REFERER'] if no r64-Param is in the Url. This Http-Header is never filtered, and the \ within the Url isn't allowed by Zend_Uri_http::validateQuery()s regexp.
Solution:
There is no reason to use the referrer as the Dummy_Request for global blocks, as they shouldn't rely on any url other than the front-page. If else, they currently wouldn't function either, as the referrer-url contains a different url then the page the user is currently visiting.