Title: Simplify use of MWNamespace::getCanonicalName()
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Apr 2018 16:28:59 +0000 (17:28 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Apr 2018 17:11:03 +0000 (18:11 +0100)
commit045e6b87383bed5551bdc3d205b7813b69ea64a5
tree7d4fd51f0eb895574e5c1e44951bd1575bb441a2
parentd13aa39760f9de5ab9c638ae417f94c786244ee7
Title: Simplify use of MWNamespace::getCanonicalName()

The exists() check performs most of what getCanonicalName() will
do a second time. Make the code more simple, DRY, and performant,
by aiming for EAFP instead of LBYL.

Also fixes a potential bug where it was using current namespace
from $this for exists(), but subject namespace (stored as $namespace)
for getCanonicalName().

Change-Id: I11539bde00bf3df3270869f40fbd62083588b50c
includes/Title.php