Rewrite OutputPage::addVaryHeader
authorGergő Tisza <tgr.huwiki@gmail.com>
Tue, 8 Sep 2015 21:59:45 +0000 (14:59 -0700)
committerGergő Tisza <tgr.huwiki@gmail.com>
Wed, 9 Sep 2015 22:01:45 +0000 (15:01 -0700)
commit6af306afa8f5e526afc2f131e2434200cd509737
tree4aa0dba113cfb400da87354ee6a2eebae656e88a
parent1e21a4bcab1826cd95ca020cd14d52bac30f3c27
Rewrite OutputPage::addVaryHeader

Rewrite OutputPage::addVaryHeader which had a very confusing
structure.

There is one breaking change: the $option argument was declared
as array|null, but the function accepted everything and showed
inconsistent behavior; e.g.

    $op->addVaryHeader( 'Foo', 'bar' )

resulted in 'X-Vary-Options: Foo;bar' but

    $op->addVaryHeader( 'Foo' )
    $op->addVaryHeader( 'Foo', 'bar' )

resulted in 'X-Vary-Options: Foo'. With the patch, non-array
arguments (other than null) result in an error.

Change-Id: Id31d95fe27b01b00ec8a1d7a3996275fc0aacf3c
includes/OutputPage.php
tests/phpunit/includes/OutputPageTest.php