Don't use HTTP_REFERER for Dummy_Request to prevent (logged) exceptions. #1234
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.