Commit 1c6e7e2
Fix: hide debug HTML comments in REST and Ajax responses (#1021)
* fix: hide debug HTML comments in REST and Ajax responses
* fix: clarify debug comment suppression messages
* Extract wpsc_skip_debug_output() to de-duplicate the non-HTML response check
The REST/Ajax/JSON/WC bail condition was copy-pasted into both wp_cache_append_tag() and wp_cache_add_to_buffer(). Move it into a single named predicate so the two call sites can't drift, and drop the explanatory comment the inline condition needed.
* Also skip debug comments on XML-RPC requests
advanced-cache.php already treats XMLRPC_REQUEST as a non-HTML response type; keep wpsc_skip_debug_output() consistent so XML-RPC bodies stay clean regardless of the <html sniff.
---------
Co-authored-by: Jake Morrison <68693+jom@users.noreply.github.com>
Co-authored-by: Donncha O Caoimh <5656673+donnchawp@users.noreply.github.com>1 parent 63e2a8a commit 1c6e7e2
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2196 | 2196 | | |
2197 | 2197 | | |
2198 | 2198 | | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
2199 | 2208 | | |
2200 | 2209 | | |
2201 | 2210 | | |
| |||
2215 | 2224 | | |
2216 | 2225 | | |
2217 | 2226 | | |
2218 | | - | |
| 2227 | + | |
2219 | 2228 | | |
2220 | 2229 | | |
2221 | 2230 | | |
| |||
2234 | 2243 | | |
2235 | 2244 | | |
2236 | 2245 | | |
2237 | | - | |
| 2246 | + | |
2238 | 2247 | | |
2239 | 2248 | | |
2240 | 2249 | | |
| |||
0 commit comments