lscache_wp icon indicating copy to clipboard operation
lscache_wp copied to clipboard

Custom ESI block fails when submitting empty form field (?s= query string)

Open davidwebca opened this issue 3 years ago • 1 comments

For some reason, our custom ESI block had trouble with some forms. I found some errors that I've been able to solve with some custom POST forms, but somehow I can't solve this one. When I use the regular search query string from WordPress, our custom ESI block just totally disappears. The HTML comments are there, no error is logged in PHP when we reset all caches...

I'll try to reproduce the issue in a fresh and closed environment to be able to send it to you, but so far it's on a whc.ca LiteSpeed enabled shared hosting setup for a private client that I can't disclose. More coming soon, but now gotta grab some sleep cuz I've been on that mystery for multiple nightly hours. 💀

davidwebca avatar Nov 21 '22 11:11 davidwebca

Alright here we go!

Fully reproduced case: https://litespeedtest.davidweb.ca/ https://github.com/davidwebca/litespeed-test

  1. Latest WordPress (6.1.1) installed through roots/bedrock
  2. Latest Sage theme roots/sage
  3. Latest WPML plugins and WooCommerce plugins + Latest WP LSCache. I only installed WPML and Woo for test purposes while trying to replicate the environment of the site where I found that bug, but it's not necessary at all (the bug happens even when they're all deactivated)
  4. The action happens in /web/app/themes/test/resources/partials/esitest.blade.php, /web/app/themes/test/resources/views/sections/header.blade.php and /web/app/themes/test/app/filters.php

When submitting (or simply visiting) the URL https://litespeedtest.davidweb.ca/?s= the big gray box disappears (it is part of the ESI no-cache block). The filters.php contains the logic that detects which "view" I am passing through to get rendered as an ESI block. This bug isn't reproducible on another of my websites with a server that doesn't have LiteSpeed enabled but with quic.cloud / CDN added in front.

davidwebca avatar Nov 22 '22 03:11 davidwebca