Added new argument to the Linker options array to allow
the forcing of an HTTP or HTTPS protocol. In order to facilitate
this, a protocol argument was added to Title::getLinkURL.
Also, an options argument was added to OutputPage::addReturnTo
so that options can be passed to the linker and so that the
returnto URL can be forced to a certain protocol.
Change-Id: Ia9cc11e310ad6ef23c221bdba3a4834e7c5556e7
Adds htmlspecialchars encoding to the link label, passed
into Linker::makeBrokenImageLinkObj.
This fixes a stored XSS (HTML injection) vulnerability.
* Released as part of 1.20wmf10, 1.19.2, 1.18.5
Change-Id: I0e5f9eeb1f3561b1354aecced74f68ae2fa20dfa
The $lang parameter defaults to false, but Message::inLanguage() doesn't
like false, so do an explicit check for false.
Change-Id: I66fb2d11269a988ae92b1594314807a4eed54f1b
If we detect and warn that the $query parameter is in an incorrect
format, we may as well convert it to the correct one.
Change-Id: Ief137ab758c65ec562c2a523f76b1a4f8c2617b5
Add Parser's extLinkAttribs attributes when an image has a link
parameter, when generating the html. Currently, these may include
rel="nofollow" and the target attribute.
This will correctly add rel="nofollow", respecting $wgNoFollowLinks,
$wgNoFollowDomainExceptions, and $wgNoFollowNsExceptions settings.
Updated parser tests for expected results, added new tests for
$wgNoFollowLinks and $wgNoFollowDomainExceptions exceptions.
Change-Id: Ib4677760ec78a3f0c4ba781d893e0484cc8db3ed
The alignment of image thumbs should follow the page content language instead of the wiki content language.
For this it needs the parser context, and because it makes sense to have it as first parameter, I renamed makeImageLink2() to makeImageLink(), the 2 seemed to be redundant anyway.
The old function name keeps the old behaviour, but can be removed quite soon since almost no extension is using it.
Change-Id: I0c35b06a85528dcc43fdd0578dc9b327c495cf4a
This change replaces I85f480726b41871cdf5349a19e3f650285d1dda6 (includes
the change of Catrope).
Add a feature to disable the rollback edit count (change
9bae2198c9) on special pages. Default it
will be disabled on Recentchanges and Watchlist.
Change-Id: Ifbbf802472ce678694b2b3ba4ef441344cc1d572
Add an edit count to rollback link to show how many edits will be
rollbacked. When the count is over 10 the text "more than 10 edits" will
be outputed.
Change-Id: I5c4050e0a9197d4c505e85685a9780c97138d427
There's no point doing potentially expensive checks (exists() and
getLength()) if the page is simply not in a content namespace.
Change-Id: I86a2b3a36071cf508b8e99ef20bdf3e0e20f3c82
This allows both methods to not always rely on global object, but also to use the local context when possible.
Change-Id: Id10f55ed9b18c889afd8d9937d9f35acb376cce4
Removed some spurious whitespace
Changed how wfRunHooks are used, and also the test for default formatting
Change-Id: I4c3fc1080f83166d7b89aeb9a1487e173e9ccb65
This method will use two new messages 'invalidtitle-knownnamespace' and 'invalidtitle-unknownnamespace' depending on the fact that the given namespace number exists or not.
I did put that method in Linker because I plan to use it in various places, notably in other QueryPage and Pager subclasses.
Change-Id: I13e7cdc2c0a8e86dc5e4b144b6012f3864d2ec06
When doing a change that break tests, update the tests in the same
commit. That makes the change more obvious and let us merge in
another branch easily.
Fixed this by "abusing" of the $options parameter of Linker::link() to pass the Language object (as we did for wfMsgExt()), has the two following advantages:
* The tooltip is displayed in the requested language instead of depending on $wgLang
* The usage of the Language object is detected in the ParserOptions, thus the parser cache key will not have "*" for the language