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

fixes #2423 - LCP image src passed properly when srcset is in play #2424

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Changes from all commits
Commits
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
fixes #2423
scottjehl authored Oct 5, 2022
commit 089befbaacd3862b8c0f790c2c56c2c4c50c1098
2 changes: 1 addition & 1 deletion www/experiments/lcp.inc
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ if (isset($lcp)) {
$lcpSource = $srcmatches[1][0];
}
} elseif (isset($lcp['element']['src']) || isset($lcp['element']['currentSrc'])) {
$lcpSource = isset($lcp['element']['currentSrc']) ? $lcp['element']['currentSrc'] : $lcp['element']['src'];
$lcpSource = isset($lcp['element']['src']) ? $lcp['element']['src'] : $lcp['element']['currentSrc'];
$lcpFullSource = isset($lcp['element']['currentSrc']) ? $lcp['element']['currentSrc'] : $lcp['element']['src'];
// get actual source attribute if we can.
$srcAttrVal = preg_match_all('/src\=\"([^"]+)/i', $lcp['element']['outerHTML'], $srcmatches);