Makes wikilinks nicer when possible
authorAntoine Musso <hashar@users.mediawiki.org>
Sun, 20 Mar 2011 14:57:49 +0000 (14:57 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sun, 20 Mar 2011 14:57:49 +0000 (14:57 +0000)
commit5da14533aa65dd3632f0821928faf8e4c4d88cc0
treeb72086949a73edfa5d33cde9a917cd7a70cc8242
parentdd02d077b6b0efddefc594005d0fdb6f7731b9a6
Makes wikilinks nicer when possible

This patch mostly impact Title:getLocalUrl() with two changes:

1) Abstraction:

$wgActionPath related code is now in Title::resolveActionPath(). It now
interprets query parameters using an array which is easier to read than
playing with a regexp and the evil $matches[].

2) Tweaking:

Change the 7 years old (r2621) URL forge:
  "{$wgScript}?title={$dbkey}&{$query}"
  => /w/index.php?title=FOO&q=2

To a nicer
  "str_replace( '$1', $dbkey, $wgArticlePath )"
  => /wiki/FOO?q=2

Additional changes:

* Parser tests were modified to reflect the changes.
* PHPUnit TitleTest amended to test getLocalUrl() (add more!!)
* When using wgActionPaths, makes sure the 'view' action is a sane default
RELEASE-NOTES
includes/Setup.php
includes/Title.php
tests/parser/parserTests.txt
tests/phpunit/includes/TitleTest.php