This should coerce nulls to empty arrays to make them play a little nicer.
Also added a doc comment that the format and contents of the $option parameter need to be described in some way; judging by the below getXVO() function they're used to produce the X-Vary-Options header along with the vary cookie settings, but offhand wouldn't know what acceptable options are or how to look them up (X-Vary-Options is something we made up as an extension for our patched Squid servers, so there's no public standard like the HTTP RFCs to look it up in.)
*
* @param $header String: header name
* @param $option either an Array or null
+ * @fixme Document the $option parameter; it appears to be for
+ * X-Vary-Options but what format is acceptable?
*/
public function addVaryHeader( $header, $option = null ) {
if ( !array_key_exists( $header, $this->mVaryHeader ) ) {
- $this->mVaryHeader[$header] = $option;
+ $this->mVaryHeader[$header] = (array)$option;
} elseif( is_array( $option ) ) {
if( is_array( $this->mVaryHeader[$header] ) ) {
$this->mVaryHeader[$header] = array_merge( $this->mVaryHeader[$header], $option );