pantheon-systems / wp-redis

WordPress Object Cache using Redis.
https://wordpress.org/plugins/wp-redis/
GNU General Public License v2.0
225 stars 67 forks source link

[CMSP-470] Replace use of wp_strip_all_tags (possibly any wp filter function?) in object-cache.php #432

Closed pwtyler closed 1 year ago

pwtyler commented 1 year ago

From WordPress.org support (cc @mdifelice)


Fatal error when combining with full-page cache

Since version 1.4.2 (at least that I am aware of), the method build_client_parameters included in the object-cache.php has been modified to escape the server configuration variables using the function wp_strip_all_tags.

If this plugin is used in conjunction with the WordPress full-page cache functionality it throws a fatal error. The reason is that in order to activate that functionality WordPress includes the file advanced-cache.php before the file wp-includes/formatting.php is included (which is in charge of defining wp_strip_all_tags). If advanced-cache.php uses object caching it must include object-cache.php but when executing the mentioned method a fatal error is raised. And if formatting.php is included or the missing function is defined somehow before it is called, a fatal error will be raised later because of a duplicate definition.

I would like to know if this is something you plan to fix in an upcoming version because, if you do not, I would need to replace the plugin. I think that probably what you want to achieve with that change can be easily achieved with a built-in PHP function, as strip_tags maybe.


Another regression/bug introduced with #400. Also tagging as related (as also affected by wp_strip_all_tags) #431