Support redirects in JavaScriptContent
authorKunal Mehta <legoktm@gmail.com>
Tue, 23 Sep 2014 22:41:03 +0000 (15:41 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 20 Jul 2015 15:36:49 +0000 (15:36 +0000)
commitad9f14d662f9597e9ca6bb4d1b572331b8256831
tree1d0ad82fd415682e87fc7198badaa5c488e9ae45
parent06c7063501cbcf201e31aae41d21dcf10af694db
Support redirects in JavaScriptContent

When a JavaScript page is moved, a "redirect" in the form of
mw.loader.load(...) will be left behind, so any other
JavaScript loading the page that way will still work, albeit
with an extra HTTP request.

This also implements Content::getRedirectTarget(), so redirects
are marked properly in the database, and users viewing them
are redirected properly. A magic "/* #REDIRECT */" comment
must be in front of the mw.loader.load call. This is done so
that pages which currently are just one mw.loader.load call
aren't turned into redirects.

Bug: 71200
Bug: 33973
Change-Id: I10fdff087a901da56fad64531f0e382f90ebcf37
includes/MediaWiki.php
includes/content/JavaScriptContent.php
includes/content/JavaScriptContentHandler.php
includes/resourceloader/ResourceLoaderWikiModule.php
tests/phpunit/includes/content/CssContentTest.php
tests/phpunit/includes/content/JavaScriptContentHandlerTest.php [new file with mode: 0644]
tests/phpunit/includes/content/JavaScriptContentTest.php