The Revision object needs the Title to determine the default content model.
Providing the Title explicitely wherever possible avoids an extra database
lookup. Most importanlty, this fixes fatal errors that ocurr when the
database lookup fails due to slave lag or transaction state.
Change-Id: I516e82f7a893b274c513b128b8a46db491160b55
This change moves the PageContentLanguage hook from Title::getPageLanguage
to Content::getPageLanguage, so the hook is no longer bypassed by
Content::getPageViewLanguage and consequently Title::getPageViewLanguage.
Change-Id: I51dabe9aee9d544483e7416a8fdf7721638d21bf
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
code.
* various undocumented function parameters
* typos in parameters declarations
Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
The introduction of the ContentHandler caused quite a few functions and hooks to
become deprecated. Usage of these has been removed in core, but is still present
in extensions. Extensions should be fixed after ContentHandler has settled in a
bit, but for now we need a way to silence the warnings.
Change-Id: Ia223243222675f778e8f8c32923f956790db0b4f
There is a bug [1] in the Title::isRedirect() method, when called from Linker,
in some cases when the link cache is not aware of a title. The bug
should be fixed ASAP. Until then, this removes the exception and maintains
same behavior as before the merge.
[1] https://bugzilla.wikimedia.org/show_bug.cgi?id=37209
Change-Id: I7874a5ecdd24417108685f811bbc2e6a2d82aa94
This introduces the ContentHandler facility into MediaWiki,
see docs/contenthandler.txt.
For convenient review, a squashed version is available at
https://gerrit.wikimedia.org/r/27191
The ContentHandler facility is a major building block of the Wikidata project.
It has been discussed repeatedly on wikitech-l.
Change-Id: I3804e2d5f6f59e6a39db80744bdf61bfe8c14f98
Created a new method User::groupHasPermission and check also
$wgRevokePermissions for the given right
Change-Id: I41edb091fa35c8c68b6f95cc5fd208ea99418cdb
Redirects should not be constructed as wikitext, since other content models
may use other mechanisms to represent redirects.
Change-Id: Id85c3b3ada1924628e4e51757573d233e998f920
Pages should never be moved in a way that would change their content model.
Without this explicite check, that might happen when $wgContentHandlerUseDB
is disabled.
Change-Id: Id1a101f56bee6f13a7259d34019c587e75a4c182
This patch adds new public accessor to the Title class. They are merely
returning the already existing conventions.
Added tests for the four new methods:
- Title::getBaseText()
- Title::getRootText()
- Title::getRootTitle()
- Title::getSubpageText()
The later does not test with $wgNamespacesWithSubpages variants.
Change-Id: I4f7230c1a5487b82d06c78a45c50436085df57be
Follow-up to I17ac68014840daa47bfd4768e978e9ff2edb00db.
Replaces some ==/!= with ===/!== and other code style
changes mentioned in Gerrit comments on previous patchset.
Change-Id: I50da16bc62241491ac5c4948e0d3059b21f113dc
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
Respecting rd_interwiki is needed to act the same way than
Special:Whatlinkshere. For local redirects it is needed to also check
for NULL, not only the empty string
Change-Id: I4f3f242d69054dcbb3c7a02441991196ba140986
Last round of easy replacements. About 30 uses in core remain (outside of HISTORY
and GlobalFunctions::wfMsg*). I'll work with IAlex and Nikerabbit to work towards
getting rid of those, too.
Updated method documentation in a few places.
Change-Id: I2491c006b62a9cc183230e31a0bd96c91e5b6142
Added parameter to Title::getFullURL to allow specification
of a protocol rather than assuming PROTO_RELATIVE. Also
added an accompanying parameter to Skin::makeSpecialUrl
to make a link for a specific protocol.
Cleaned up the creation of personal URLs in SkinTemplate.php
so that when $wgSecureLogin is enabled, the returnto
query is not lost in the process.
Note: This will only work if $wgServer is set to a
protocol relative URL.
Change-Id: Iba48eb3620fb3a721220364185f7abfd902412d0
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>
Even when $auth=false, moveToInternal() would unconditionally check
$wgUser's 'suppressredirect' permissions and override $createRedirect.
This means it was impossible to suppress redirect creation when moving
pages in a maintenance script, even when telling moveTo() to disable
permissions checks.
Fixed by moving the check from moveToInternal() up into moveTo() and
respecting $auth there
Change-Id: I9b52dc67c7ae2dbda3ca62f78d4d7df118771c0f
* The problem is that Title::userIsWatching() relies on $wgUser,
which is not suitable on every case. Instead User::isWatched()
requires both an User and a Title object.
* Replaced all core calls from the former to the latter
* Added a cache in User for the WatchedItem instances so we do not
need to do a database request every time something want to know
whether a page is watched or not, which can happen several times
per request.
Change-Id: Ifa9c55b7ffb487ce6893c74df233eedc7654dc5e