3.17 - regex to remove data-rocket-location-hash
mismatch
#6910
Labels
effort: [S]
1-2 days of estimated development time
module: ALR
Issues related to the Automatic Lazy Rendering feature
priority: high
Issues which should be resolved as quickly as possible
severity: major
Feature is not working as expected and no work around available
type: bug
Indicates an unexpected problem or unintended behavior
Milestone
Before submitting an issue please check that you’ve completed the following steps:
Tested in 3.17 alpha 1
Describe the bug
The current regex to clear
data-rocket-location-hash
has mismatches and removes whole elements.wp-rocket/inc/Engine/Optimization/LazyRenderContent/Frontend/Controller.php
Line 79 in 21261f3
https://gist.github.com/DahmaniAdame/92f8f5aeb6ffeffda846585bea6c20fa
Changing the regex pattern to
/data-rocket-location-hash="[^"]*"/i
picked the right elements (to be further tested by QA):https://gist.github.com/DahmaniAdame/8f2ce6da9d1ee052f2c1d155776645d9
Testing sample: https://gist.github.com/DahmaniAdame/2146eec70321898bf1e8f42cd2cdf0f6
To Reproduce
N/A
Expected behavior
data-rocket-location-hash
should be dismissed accurately without causing any missing elements.Screenshots
N/A
Additional context
N/A
Acceptance Criteria (for WP Media team use only)
Clear instructions for developers, to be added before the grooming
The text was updated successfully, but these errors were encountered: