-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style sanitizer contains a piece of logic that doesn't seem to have any effect #3232
Comments
Note: the initialization of the array needs to be removed as well:
|
Good catch. This code should have been removed with #3187. It used to be used here, being introduced in #2346: amp-wp/includes/sanitizers/class-amp-style-sanitizer.php Lines 3044 to 3082 in 1b38600
|
Curious: How did you find this logic was not being used? |
@westonruter PHPStorm actually shows this (at least with my current settings): You can see that the code is grayed out, which means it is not being used. When you hover over it with the mouse, you'll get additional information. |
Oh, I just noticed that this actually comes from a paid addon to PHPStorm: https://kalessil.github.io/php-inspections-ultimate.html I can heartily recommend this plugin, and @kalessil is extremely responsive if you hit issues or have ideas for additional checks. |
The style sanitizer contains piece of logic that stores "$indices_by_stylesheet_element_id". However, the entire array is only assembled, but never used.
amp-wp/includes/sanitizers/class-amp-style-sanitizer.php
Lines 2907 to 2910 in 7ba9f26
This entire snippet could just be removed, to save processing time and memory.
The text was updated successfully, but these errors were encountered: