Fix empty auto-summaries triggering a fatal error.
authordaniel <dkinzler@wikimedia.org>
Tue, 21 May 2019 10:16:22 +0000 (12:16 +0200)
committerdaniel <dkinzler@wikimedia.org>
Thu, 30 May 2019 14:34:34 +0000 (16:34 +0200)
commit0c4410a6233da6ee3e844f60b06a68f78a27ebd3
tree73746ddbc289ea5d0419de60d54b77d7db4e2742
parentceb1cd276fd6b46bf063b30232dd54af2c613b01
Fix empty auto-summaries triggering a fatal error.

Aka:  Streamline Linker::formatAutocomments() and add tests

This uses the "streamlining" for the code proposed by Thiemo
in I38edc1ad7720. I have squashed the two commits, so it now
has his code in Linker, but still has my tests as well as his.

Thiemo wrote on his patch:
This also changes the output in case there is no fragment to link to.
Before an empty `/* */` in a summary this would have created a link to
the page. I would like to argue this is not what a user expects.

Bug: T222628
Change-Id: I05408ede0e20dfd976f4057fc5baab461d2ef769
includes/Linker.php
tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/title/MediaWikiTitleCodecTest.php