This commit caused a PHP notice if you tried to use diff=prev with an
oldid which was the first revision of the page.
Change-Id: I4c4ccb9a0c8d82e104723a2e72f1c699e2fc249b
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments
Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
To only show rollback links if they work I had to patch Linker
to have a function (Linker::rollbackData) which can verify
that the editor isn't the only editor of the page. Furthermore
it is checked that the user name or the text of the revision
we might rollback to isn't deleted. Due to the fact that I've
altered the already existing method which showed how many edits
a rollback will revert for that, this wont affect the performance.
Change-Id: I5d1adec993370c39ae8c5c712edd919d456441c6
Implement AJAX patrolling with the new mediawiki.page.patrol.ajax
module, which makes use of the API via mediawiki.api.
During the patrol process a spinner (created by jquery.spinner)
shows up and after it a suitable message gets shown via
mediawiki.notify.
Depending on whether we had success or not the link then turns up
again or the brackets completely disappear just like on a normal page view.
On top of adding the module, I've changed the following:
- Added the patrol token to the ResourceLoaderUserTokensModule.
- Registered messages 'markedaspatrollednotify' and
'markedaspatrollederrornotify'.
Change-Id: I472357566dda0ab572c20e2e4b87508b0f2f4c73
Before the introduction of the content handler, missing content was
signified by getText() returning null instead of a string. null will
work much like an empty string in most contexts, so in many places,
it was not checked explcitely whether the conent was null.
Now, when getContent() returns null, this often caused a fatal error,
because the code would access whatever getContent() returned as an object,
without checking whether it was null (because no such check was performed
previously, when the content was represented as a string).
This check introduces explicite checks for getContent() returning null
in the most essential core classes.
Change-Id: I551a90b0b67b8edc7570ca5d252ecc1de903f097
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
Also passed some $wgUser direct (when already there), so it is seen by
someone, that the user should be passed to that method.
Change-Id: Id4d5504a05ea34d80d59262ad3aef28f09c807a6
- This is needed to for I90965346 ((bug 37453) Move
$wgDisable(Lang|Title)Conversion to ParserOptions)
because that change sets an option based on the Title,
and I don't want to duplicate that to all ParserOptions
that need it.
- Refactored ApiParse to have a WikiPage object available
and changed some part to take advantage of having this
object available. Also used ApiBase::getTitleOrPageId()
to reduce code duplication.
Change-Id: Iec98e472af9c43d940f77261367a796b0d7b4b54
ContentHandler::runLegacyHooks can be used to run hooks that don't
supprot Content objects yet. runLegacyHooks will issue a warning and take
case of serialization/unserialization of the content as appropriate.
Changeset 2: rebased.
Change-Id: I31109061110f87c38bdeebf30d520c8e1241bb29
* Replaced WikiPage::DATA_FROM_* constants with IDBAccessObject ones.
* Renamed IDBAccessObject constants a bit for visual consistency.
* Removed AVOID_MASTER parameter and replaced calling instances with READ_NORMAL.
Instead of getting page_latest from the master and the revision from a
slave, just get it all from the master in one RTT. Most callers used
AVOID_MASTER (and now READ_NORMAL), so this case is barely hit anymore.
Change-Id: Ifbefdcd4490094b38e49bbb46c95fdb71b5c9e1a
This comes from
https://translatewiki.net/wiki/Thread:Support/MediaWiki:Missing-article
that asks for a link to the deletion log in the
'missing-article' message.
Instead of simply changing that message I replaced
it with two news messages 'missing-revision' when trying
to view an old revision and 'difference-missing-revision'
when showing a difference. This removes the "lego"
construction of 'missing-article' with 'missingarticle-rev'
and 'missingarticle-diff' submessages.
I had to keep current messages since they are still
used in extensions.
Change-Id: Ibe60c84cfea922a78b3ad22cc48185a109cd617d
This allows both methods to not always rely on global object, but also to use the local context when possible.
Change-Id: Id10f55ed9b18c889afd8d9937d9f35acb376cce4
* The main Revision functions now allow various QoS and locking flags.
* Added tiny DBAO interface add made Revision implement it.
Since a lot of objects will need (or have) the same functionality.
* Use "self" keyword in Revision class consistently.
* Made Revisison::newFromConds() private.
Change-Id: I3139956999218a2bb44b5c845b8079e33b2328bb
We had two way to get a temporary directory:
- $wgTempDirectory: more or less stable accross sessions
- wfTempDir(): set through environnement variable and could potentially
vary from a session to another one thanks to tempnam()
This patch makes wfTempDir() to always use the global $wgTempDirectory
first when it is available. Thus explicitly overriding tempnam() or any
environnement variable such as TMP or TEMP.
Hence, people who don't have access to a system wide directory
specificed by their environnement (such as /tmp) can specify an
alternative straight from the MediaWiki configuration.
The patch remove references to $wgTmpDirectory and replace them with
calls to wfTempDir(). Make wfTempDir() use $wgTmpDirectory first.
The default setting of $wgTmpDirectory was removed in favor of having it
initialized through Setup.php by calling wfTempDir.
Note: this may also address Bug 36475 - Generating thumbnails does not
work when there is no access to /tmp
Change-Id: Ifdc79e9c5d95f978025b237a5eeb95fd75092f46
Original patch by Nischay Nahata.
Patchset2: amended commit message to be shorter and clearer.
Patchset3: use wfMessage()->text() instead of default parse()
Patchset4: remove unneeded tabs.
Patchset5: added git difference-title to maintenance/language/messages.inc .
Patchset6: moved OutputPage::setPageTitle() calls to DifferenceEngine and added difference-title-multipage message
Patchset7: Fixed an error in messages.inc from the last changeset
Patchset8: Removed the diff page subtitle according to Brion's
suggestions. Note: I am doing this almost a month since
committing the original patch. Rebasing proved to be too
tricky, so I tried to cherry-pick the original commit
in a new branch. Apparently, Git identified it. If this
works as planned, it must be a miracle.
Patchset9: removes unneeded changes to message files
Change-Id: I4e6363529a1e77a3f5267ec6871e8dea0354f043