ParserOptions: Fix handling of 'editsection'
authorBrad Jorsch <bjorsch@wikimedia.org>
Sun, 11 Jun 2017 14:49:32 +0000 (10:49 -0400)
committerTim Starling <tstarling@wikimedia.org>
Wed, 14 Jun 2017 04:52:36 +0000 (04:52 +0000)
commit46c0c39514298d2ed119e6665a180d023eed4207
treea3932399c410e8e15b1a28ffb03671adc1109f78
parentfbc144965315cb1360500ef08ae9f4af15e76c43
ParserOptions: Fix handling of 'editsection'

The handling of the 'editsection' option prior to I7fb9ffca9 was
unusual: it was included in the cache key, but the getter didn't ever
flag it as "used". This was overlooked in I7fb9ffca9.

This fixes the handling to restore that behavior. It's no longer
considered to be a real parser option, so changing it won't make
isSafeToCache() fail while reading it won't flag it as 'used'.

But to keep Wikibase working (see T85252), if 'editsection' is supplied
in $forOptions optionsHash() will still include it in the hash so
whatever Wikibase is doing by forcing that doesn't break. The hash when
it is included is the same as was used in I7fb9ffca9 to reuse keys.

Once optionsHashPre30() is removed, Wikibase should be changed to use
some other method to fix T85252 so we can remove that hack from
optionsHash().

Change-Id: I77b5519c5a1122a1fafbfc523b77b2268c0efeb1
includes/parser/ParserOptions.php
tests/phpunit/includes/parser/ParserOptionsTest.php