From: Brion Vibber Date: Sat, 22 Jan 2011 16:59:01 +0000 (+0000) Subject: * (bug 26861) avoid warning in OutputPage::addVaryHeader when $options param is null X-Git-Tag: 1.31.0-rc.0~32434 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=cb3d7eb63d291a649c68ca3f65e11c36b5569d0d;p=lhc%2Fweb%2Fwiklou.git * (bug 26861) avoid warning in OutputPage::addVaryHeader when $options param is null 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.) --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 960b293aaf..caa5fd1360 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1471,10 +1471,12 @@ class OutputPage { * * @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 );