r80755 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80754‎ | r80755 | r80756 >
Date:16:59, 22 January 2011
Author:brion
Status:ok
Tags:
Comment:
* (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.)
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -1471,10 +1471,12 @@
14721472 *
14731473 * @param $header String: header name
14741474 * @param $option either an Array or null
 1475+ * @fixme Document the $option parameter; it appears to be for
 1476+ * X-Vary-Options but what format is acceptable?
14751477 */
14761478 public function addVaryHeader( $header, $option = null ) {
14771479 if ( !array_key_exists( $header, $this->mVaryHeader ) ) {
1478 - $this->mVaryHeader[$header] = $option;
 1480+ $this->mVaryHeader[$header] = (array)$option;
14791481 } elseif( is_array( $option ) ) {
14801482 if( is_array( $this->mVaryHeader[$header] ) ) {
14811483 $this->mVaryHeader[$header] = array_merge( $this->mVaryHeader[$header], $option );

Follow-up revisions

RevisionCommit summaryAuthorDate
r808971.17: MFT r80697, r80755, r80767, r80771, r80773, r80774, r80779, r80816, r80...catrope18:57, 24 January 2011

Status & tagging log