The regex in JavaScriptContent and CssContent was trying to pass
urlencoded stuff to Title::newFromText(), which would fail. Make sure we
urldecode it first.
Bug: T208264
Change-Id: I189c4c308da2875839ad8c1061332500f0e6d244
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable
For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore
Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
Just like ad9f14d662 which was for JavaScript. The redirect will be
of the form "/* #REDIRECT */@import url(...);".
Bug: T73201
Bug: T35973
Change-Id: I10bae44af4b4923f8797172702974cd45dc25ab4
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
This hooks allows extensions to override the normal model-specific
rendering of page content. A typical use would be to provide syntax
highlighting for pages that contain scripts. In that sense,
ContentGetParserOutput is a generalization of the old ShowRawCssJs
hook.
This, together with I76412f9d, is a (hopefully) fixed version of the
reverted Ibfb2cbefea44.
Change-Id: I979e2438689648ba4c959d8083197ef14ce524e8
This change removed getHtml(), but not the call to it from fillParserOutput.
It has a few other issues that I'll flag in-line after deploying the revert.
This reverts commit fda090a7e7
Bug: 49398
Change-Id: Idcef8d4cedc7c03f72bc1743e0f89cc5ed4ad7a7
This hooks allows extensions to override the normal model-specific rendering
of page content. A typical use would be to provide syntax highlighting for
pages that contain scripts. In that sense, ContentGetParserOutput is a
generalization of the old ShowRawCssJs hook.
Change-Id: Ibfb2cbefea44eeee9f2a027f47e7721bf177ba0f
Syntax:
* Call parent setUp from setUp.
* Set required globals for the test inside the test class instead
of assuming the default settings.
* Data providers are called statically and outside setUp/tearDown
("public static function")
* Test function names should be prefixed with "test"
("testIsRedirect")
* Marked 2 functions as unused. JavascriptContentTest has 2 data
providers for tests that don't exist in it (nor in TextContentText)
but do exist in WikitextContentTest.
Style:
* Single quotes
* Remove odd comment "# =====" lines
* Consistent tree wrapping with arrays.
array(
array(
.. ) );
array(
array(
..
)
);
Some were closing on the previous line instead.
Made it consistent now.
* Remove odd indentation to make nested arrays line up:
array( 'foo' => array( 'bar' => true,
'baz' => array() ) )
array( 'foo' => array(
'bar' => true,
'baz' => array()
) )
We don't do this kind of indentation because it is fragile
and becomes outdates when any of the earlier keys ("foo")
change. Converted to a regular tree instead.
Also triggered git warnings for mixing spaces with tabs, which
is almost always an detector for this style.
* Not using @annotations in inline comments, reserved (and only
parsed/meaningful) for block comments.
Follows-up 8b568be5e2
Change-Id: Ic55d539b9a58f448b550bcd98894d389764e0694