Possible bug in output buffering for infinite scroll #17050
Labels
[Feature] Infinite Scroll
Good For Community
[Pri] Low
[Type] Bug
When a feature is broken and / or not performing as intended
Also see arnowelzel/lightbox-photoswipe#45 about this.
See the following code fragment:
jetpack/modules/infinite-scroll/infinity.php
Lines 1335 to 1341 in ec88783
What this does:
wp_head()
However this causes a lot of problems if
wp_head()
does not create any output (which might happen in rare cases). Also note thatob_end_clean()
only needs to be called once - after calling this, there is no buffer any longer (also see https://www.php.net/manual/en/function.ob-end-clean.php). On the other hand it also must be called every time after usingob_start()
and not only if there is anything in the buffer.My plugin "Lightbox with PhotoSwipe" won't work at least on one site using infinite scroll and the fix by the user was to add
ob_end_clean()
after thewhile()
-loop. The correct code should be:The text was updated successfully, but these errors were encountered: