Skip to content
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

Closes #6599 validate image source before saving it into the DB #6605

Merged
merged 22 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2b3eb92
Just send elements with images (bg or src)
wordpressfan May 2, 2024
fe32023
Validate the image src to make sure it's a valid image
wordpressfan May 2, 2024
5026c47
refactor add_lcp_data nested part and change the logic to only check …
wordpressfan May 2, 2024
7282c38
some more enhancements
wordpressfan May 2, 2024
f085a49
add a filter for validating the image
wordpressfan May 3, 2024
d38508b
fix old tests and add more tests
wordpressfan May 24, 2024
63d3ce7
Merge branch 'refs/heads/develop' into fix/6599-validate-image-src
wordpressfan May 24, 2024
7ec3c8e
Comply feedback
Miraeld May 26, 2024
3764b34
Merge branch 'develop' into fix/6599-validate-image-src
jeawhanlee Jun 5, 2024
89038e3
fix most of unit tests
wordpressfan Jun 5, 2024
c46e6ca
Merge branch 'refs/heads/develop' into fix/6599-validate-image-src
wordpressfan Jun 6, 2024
fbc765e
fix tests by supporting only src attribute if it's found
wordpressfan Jun 6, 2024
a852279
Updated fixture
jeawhanlee Jun 10, 2024
d07c3f6
Added svg to allowed mime types and return false with chrome paths
jeawhanlee Jun 10, 2024
4e9c562
phpcs fix
jeawhanlee Jun 10, 2024
54ff310
Updated tests
jeawhanlee Jun 11, 2024
a393f39
Updated controller
jeawhanlee Jun 11, 2024
e34c587
phpcs fix
jeawhanlee Jun 11, 2024
3dae306
guard filter
jeawhanlee Jun 12, 2024
049ac4d
Added minified version of beacon script
jeawhanlee Jun 13, 2024
0b80d3c
Merged develop into fix/6599-validate-image-src
jeawhanlee Jun 13, 2024
77f89a5
Merge commit '5b286ce8c571285bd0924f8f223440e7f9f4c0b4' into fix/6599…
MathieuLamiot Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/js/lcp-beacon.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class RocketLcpBeacon {

_fillATFWithoutDuplications(elements) {
elements.forEach(({ element, elementInfo }) => {
if ( this._isDuplicateImage(element) ) {
if ( this._isDuplicateImage(element) || !elementInfo ) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion assets/js/lcp-beacon.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading