[De-AMP] Regex does not check for empty value of ⚡ attribute #22573
Labels
bug
OS/Android
Fixes related to Android browser functionality
OS/Desktop
privacy/de-amp
QA Pass - Android ARM
QA Pass-macOS
QA Pass-Win64
QA/Test-Plan-Specified
QA/Yes
release-notes/exclude
Milestone
From: https://bravesoftware.slack.com/archives/C03BE3VNL06/p1651027881491089?thread_ts=1650911256.912569&cid=C03BE3VNL06
"Regarding the buggy behavior: Our amp-detection (in part) looks for the ⚡ attribute without an explicit value (i.e. [⚡] vs [⚡=''] ). When the attribute is followed by ='', it no longer matches our current regular expression.
There is no reason why a web-author would provide the empty value, so this pattern is not likely to be encountered often, if ever, in the wild. That said, we found a scenario today which could yield this pattern.
When setting out to test an NBCNews AMP page locally, I downloaded the page via right-click, Save As on Windows. This process modifies the markup in a couple ways, one of which includes adding ='' after the ⚡ attribute.
So if an individual were to download an AMP page (via Save As), and re-upload it elsewhere, we would not properly bounce/redirect visitors to the second version."
We have this check for amp="", but not ⚡=""
The text was updated successfully, but these errors were encountered: