Title: PHP Warning: Array to string conversion
Last modified: February 13, 2025

---

# PHP Warning: Array to string conversion

 *  Resolved [glashkoff](https://wordpress.org/support/users/glashkoff/)
 * (@glashkoff)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/php-warning-array-to-string-conversion-5/)
 * Hello. Thank you for the plugin. I originally posted this as a comment in a relevant
   thread, but it was somehow deleted. Therefore, I am trying to bring attention
   to the issue of the plugin’s code quality with a separate post in a more detailed
   form.
 * In various configurations (when running a WP site in Docker with Nginx and Varnish,
   including a clean setup without other plugins), frequent errors of the following
   type can be encountered:
 *     ```wp-block-code
       PHP Warning: Array to string conversion in /plugins/breeze/inc/cache/execute-cache.php on line 540PHP Warning: Array to string conversion in /plugins/breeze/inc/cache/execute-cache.php on line 554
       ```
   
 * The problem is that, judging by the code in execute-cache.php, you expect string
   variables to be passed to header(). However, in reality, this is not always the
   case.
 * In $data on line 539, on different sites where I installed the plugin, I’ve observed
   the following (for example):
 *     ```wp-block-code
       array (  'name' => 'x-xss-protection',  'value' =>  array (    0 => '1; mode=block',    1 => '1; mode=block',  ),)
       ```
   
 * The reason for this is that some plugins, themes, and server software can add
   headers at different stages of page generation. While this might not be a completely
   normal situation because it can lead to values that are not correctly interpreted
   by the browser, it does happen and needs to be considered. The Breeze plugin,
   as far as I can see, does not take this situation into account.
 * You should simply add a check there for the presence of an array and take only
   one value. Perhaps even warn the user that such a problem exists.
 * There is also another issue with header() in execute-cache.php: working directly
   with header is insecure and often redundant. Frankly, I didn’t understand why
   this is even needed in a caching plugin, but if it is indeed necessary, then 
   you should at least take care to filter headers from newline characters to avoid
   accidentally creating a situation where multiple headers can be passed through
   a single variable.

Viewing 1 replies (of 1 total)

 *  Plugin Author [owaisalam](https://wordpress.org/support/users/owaisalam/)
 * (@owaisalam)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/php-warning-array-to-string-conversion-5/#post-18312807)
 * First of all, thanks for the detailed explanation. We have fixed this issue in
   version 2.2.3.
 *  Please update to the latest version.

Viewing 1 replies (of 1 total)

The topic ‘PHP Warning: Array to string conversion’ is closed to new replies.

 * ![](https://ps.w.org/breeze/assets/icon-256x256.gif?rev=3352595)
 * [Breeze Cache](https://wordpress.org/plugins/breeze/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/breeze/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/breeze/)
 * [Active Topics](https://wordpress.org/support/plugin/breeze/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/breeze/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/breeze/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [owaisalam](https://wordpress.org/support/users/owaisalam/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/php-warning-array-to-string-conversion-5/#post-18312807)
 * Status: resolved