From: Catrope Date: Fri, 1 Jun 2012 10:19:53 +0000 (-0700) Subject: Fix bug in getXVO() that produced XVO headers with stray semicolons X-Git-Tag: 1.31.0-rc.0~23159^2~1 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=07c643f21590b740b7c32cd1ab6d3a0ba7ebeb97;p=lhc%2Fweb%2Fwiklou.git Fix bug in getXVO() that produced XVO headers with stray semicolons addVaryHeader() converts $options to an array, so null values (no XVO options) are converted to empty arrays. This led to headers like: X-Vary-Options: Foo;string-contains=bar,Baz;,Quux;string-contains=xyz This fix changes the "Baz;," part to "Baz," Change-Id: I2fa0b374f5d4cfa6b894cbd9de8c14354f04ad86 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 560588f43d..35b2f38580 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1739,7 +1739,7 @@ class OutputPage extends ContextSource { $headers = array(); foreach( $this->mVaryHeader as $header => $option ) { $newheader = $header; - if( is_array( $option ) ) { + if ( is_array( $option ) && count( $option ) > 0 ) { $newheader .= ';' . implode( ';', $option ); } $headers[] = $newheader;