Linker: Avoid passing false to Title::newFromText
authorThis, that and the other <at.light@live.com.au>
Thu, 28 Jan 2016 14:03:18 +0000 (01:03 +1100)
committerTim Starling <tstarling@wikimedia.org>
Wed, 2 Mar 2016 23:10:28 +0000 (23:10 +0000)
commitc99e3d537ede1628f1bc2d833e5285a2dd083399
tree57e0b394a7bf05cb6d7c24f76038cc4f089efbf3
parentee1d97b3cc731618d184facba9dec0f1afda0833
Linker: Avoid passing false to Title::newFromText

This is needed because the call to substr() returns false when the string
is only 1 character long, which occurs when parsing degenerate links like
[[:]] and [[::|foo]].

The seemingly unnecessary test for $match[1] !== '' is for forwards
compatibility with PHP 7.

Bug: T121706
Change-Id: Icc19ee990d01958d64b938d298e9a7e1df7181b5
includes/Linker.php