From 83ac1625cce0fa0998e3241fff62a793f8db62ed Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Sat, 9 Aug 2025 13:46:18 -0400 Subject: [PATCH] Decode URLs when parsing them from content WordPress stores URLs in the post content as html entity encoded. Thi means in cases when there are images in the content that have query params, currently our replacements around the use of `presign` break. In all other cases `tachyon_url()` expects a clean URL, not a htmlentities applied one, so we make sure to be consistent. --- inc/class-tachyon.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/class-tachyon.php b/inc/class-tachyon.php index 55580e1..34ee767 100644 --- a/inc/class-tachyon.php +++ b/inc/class-tachyon.php @@ -206,6 +206,9 @@ public static function filter_the_content( $content ) { $src = $src_orig = $lazy_load_src[1]; } + // Image src coming from HTML is expected to be htmlentityencoded. + $src = html_entity_decode( $src ); + // Check if image URL should be used with Tachyon. if ( self::validate_image_url( $src ) ) { // Find the width and height attributes.