Submit the guest order tracking form with POST - #229
Draft
boo-code wants to merge 1 commit into
Draft
Conversation
The form carries the shopper's email address, and submitting it with GET puts that address in the URL. It is then recorded by analytics as a page path, kept in the browser history and written to the access log and any referrer. The controller reads the fields with Tools::getValue(), which takes POST as well, so no controller change is needed and links that already carry the parameters in a query string keep working.
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.
Why
templates/customer/guest-login.tplsubmits the tracking form withmethod="get", and the form holds afield named
email. Submitting it therefore produces a URL of the shape/guest-tracking?order_reference=...&email=someone@example.com.That is the report in PrestaShop/PrestaShop#13911: email addresses visible in Google Analytics page
paths. A URL carrying the address does not only reach analytics — it is also kept in the browser history,
written to the web server access log, and sent as the referrer to anything the page loads.
What it does
Switches the form to
method="post".Tools::getValue()reads$_POSTbefore$_GET(classes/Tools.php), andGuestTrackingControllerreads
order_referenceandemailthrough it, so no controller change is needed. Links that alreadycarry the parameters in a query string keep working, since the controller still accepts them.
The hidden
controllerinput is left in place. It exists because a GET form replaces the action's querystring with its own fields; with POST the action's query string is preserved and the input is simply
harmless.
How to test
...&email=someone@example.com. After: the URL carries no email.?order_reference=...&email=...still resolves the order.