mw.ForeignApi is an extension of mw.Api, automatically handling
everything required to communicate with another MediaWiki wiki via
cross-origin requests (CORS).
Authentication-related MediaWiki extensions may extend it further to
ensure that the user authenticated on the current wiki will be
automatically authenticated on the foreign one. A CentralAuth
implementation is provided in I0fd05ef8b9c9db0fdb59c6cb248f364259f80456.
Bug: T66636
Change-Id: Ic20b9682d28633baa87d22e6e9fb71ce507da58d
* Refactor NamespaceInputWidget into two widgets: NamespaceInputWidget
and ComplexNamespaceInputWidget. The former is now only the dropdown
(and inherits from DropdownInputWidget), the latter is the dropdown
plus two checkboxes.
* Change ComplexNamespaceInputWidget configuration to take nested config
for `invert`, `associated`, and `namespace`, rather than require
parameters like `invertName` and so on for every combination.
* Implement standalone JavaScript versions of both widgets (previously
mw.widgets.NamespaceInputWidget could only be created via infusion
of the PHP widget).
Bug: T99256
Bug: T106138
Bug: T109559
Change-Id: Ie2fee6d035339ceb934fca991675480db3d630d1
Though this script was run on Wikimedia sites years ago (see T8399), there
are enough reasons to doubt it will be run again:
* There is a hardcoded maximum page_id value, which would have to be
changed or removed before reuse.
* It scans the entire page table in a single SELECT query and stores all
values of page_id and page_latest in a PHP array, which might not be
feasible on a large wiki.
* It writes directly to slaves. In contrast, the manual page for
pt-table-sync (from Percona Toolkit) says in general, "[...] it always
makes the changes on the replication master, never the replication slave
directly. This is in general the only safe way to bring a replica back
in sync [...]".
* It only works on the page/revision/text tables. In contrast, pt-table-sync
can work on any table having a primary key.
* It does try to detect whether revisions are missing on the master (instead
of on the slave). However, this won't work because of a bug introduced in
r91243 / bb1df74f87 (it actually queries the master twice and puts the
second result set in $slaveIDs).
Change-Id: I85c98821af308abf7dde8068d7cbca17d06b1362
Migrate the move protect log as first sub type of the protection log,
because it does not have complex log parameter, which needs some way of
handling/migration.
It also keeps the gerrit change smaller and hopefully makes review
easier.
The other sub types of the protection log will be migrated in a later
patch set.
This allows use of gender on Special:Log. Old message is kept for use
in IRC. A test was added to ensure an unchanged IRC message.
Bug: T47988
Change-Id: I57b3bd8a7dc823acdbb56520d2364f5542283373
This is a set of classes written for Echo to simplify writing
maintenance scripts that iterate over an entire table and update
some of those rows.
This has shown to be reusable elsewhere, especially the BatchRowIterator
class and will be useful to have generally avilable in core. The Echo
classes are all prefixed with the Echo name so there wont be any
conflict is both are installed.
Change-Id: I64c1751106caf34f41af799dbaf8794115537f06
Add a Monolog Formatter class that uses
MWExceptionHandler::getRedactedTraceAsString when outputting stack
traces.
Bug: T107440
Change-Id: Ic580c137e27aac95435f7b073a18cf61820b172f
Issues with spacing (T107311), probably shouldn't have
been merged right before the branch cut.
This reverts commit 9508c5bd57.
Change-Id: Ibf2ca5a33b8ab0f7381c720c6c92fbfd7a7c819d
* Added a "storageLayout" flag to LocalRepo config (supports "sha1")
* Added a simple migration script to copy files the SHA1 paths
* Currently works with img_auth.php + thumb_handler.php for URLs
* Added visibility to some LocalFile methods
* Simple tests for the wrapper class.
Co-Authored-By: Gilles Dubuc <gdubuc@wikimedia.org>
Change-Id: Iad46ad669c8ae3c02d10da10c3f7a16fe161663f
Bug: T1210
To use OOUI for forms with user name autocomplete, the new widget
UserInputWidget interacts like the jQuery pendant (working with css
class "mw-autocomplete-user").
It is also available in HTMLForm as "user".
Example usage: Iaeff912e6437d6ebef0d5b1919ce8cf53a7fd5f1
Change-Id: I9501c85f4288c255bbe3a5284e99b57b6169916f
* Add PHP version of NamespaceInputWidget, co-authored by Florian,
which consists of a DropdownInputWidget offering a choice of
namespaces and two CheckboxInputWidgets allowing to also match
associated namespace (talk/content) or to invert the choice.
* Add an incomplete JS version of NamespaceInputWidget, which is only
really functional when infused from the PHP version (it can't
generate the dropdown by itself, for example). Implement some JS to
improve the experience of selecting the "all namespaces" option in
the dropdown (by disabling the checkboxes when this happens).
* Split off a 'mediawiki.widgets.styles' module, which has the basic
styles for PHP widgets which are to be loaded in the head. Make
OutputPage::enableOOUI() also add this module (which should stay
reasonably small).
* Use the new widget in HTMLForm's HTMLSelectNamespace field. It can
be seen in action on Special:LinkSearch, for example.
Co-Authored-By: Florian <florian.schmidt.welzow@t-online.de>
Co-Authored-By: Bartosz Dziewoński <matma.rex@gmail.com>
Change-Id: I5cbfa9d0f6a8641148ce476b7dbe65e9096b4485
* WikiPage is the first caller to use this instead of DIY
* This can be used elsewhere to keep callers uniform
Change-Id: Ia6371eaa185d70d1431271b2c6c955523cd424e8
HTMLTitleTextField will automatically validate title input, can
optionally ensure the title is in a specific namespace, is creatable, or
already exists.
The field currently doesn't support GET requests since validation on
empty strings fails.
Bug: T104420
Change-Id: I45718462570d0a523a148c3830b1116b634df050
* IDEs can now make sense of IDatabase, which is useful for
lazy connections. The interface might also help lower coupling.
* This also updates DBConnRef, which implements IDatabase
* Some discouraged methods are left out of IDatabase.
These methods either encourage manual query building,
are only needed by the updater, are obscure/unused,
or either wise encourage bad practice. DBConnRef still
supports these if called to avoid breakage though.
Change-Id: Ia83530820f185415725c1d5f54b5172121b4938f
Special:ChangeContentModel allows for users with the 'editcontentmodel'
right to change the content model of a page.
Visiting Special:ChangeContentModel will contain an input field for a
page title. The user will then be sent to
Special:ChangeContentModel?pagetitle=<input> where the page title is
read only, with a content model selector and optional reason field.
The special page only allows converting between content models that
extend TextContent for simplicity. Advanced conversions should be done
via the API.
All content model changes via the special page or API generate a null
revision in the page history and a log entry at
Special:Log/contentmodel. The log entry has a revert link for
convenience (like the move log).
Bug: T72592
Co-Authored-By: Lewis Cawte <lewis@lewiscawte.me>
Change-Id: I296a67c09fcbc880c8c3a648eb5086580725ea46
Instead of littering includes/ with stub back-compat aliases, house such
classes in includes/compat/.
Change-Id: I4c1b83e35c8d6c18777a4a3e17d81023915cfb7f
Adds basic image size detection for WebP and support in the
MediaHandler. Currently renders WebP files as PNGs, because that
handles transparency.
Bug: T50519
Change-Id: I3c00653a8a034efc3f6b60fe62b7ac2e5391f921
* Transform all input fields to use HtmlForm as preparation for enabling
MediaWiki UI eveywhere.
* Remove protected whitespace for HTMLCheckField (adds empty line to div-layout)
* Add a new HTMLForm input field "Text with Button" and "Namespaceselector with Button"
Bug: T73434
Change-Id: I53cc019c3ca94cec8f3c05500d0c604c1af7f688
Implementation written by Fred Emmott of Facebook. Quoting Fred:
As well as array access being faster, the main advantage is actually
that this significantly reduces the use of unserialize(), which does a
lot of memcpys when making the strings.
Benchmarks compared to LCStoreCDB:
* HHVM (no repo-auth): ~7% improvement
* HHVM (with repo-auth): ~12% improvement
* PHP7: ~1% improvement
My (Legoktm) brief testing noted that the generated PHP files were
noticiably larger than the CDB ones:
* 1.5M en.l10n.php
* 932K l10n_cache-en.cdb
Bug: T99740
Change-Id: Ib2c5856d40cd928cab4a79cb935b3ce08c598300
Make password policies defined in a configurable policy, which is
defined by group. A user's password policy will be the maximum of
each group policy that the user belongs to.
Bug: T94774
Change-Id: Iad8e49ffcffed38df6293db0ef31a227d3962003
Follows-up 4a3e50a54.
* Merge mediawiki.jqueryMsg.data and mediawiki.jqueryMsg modules.
There's no need for this to be a separate module. The data is not for public consumption,
it's provided to jqueryMsg only.
* Remove unused default-default values for 'allowedHtmlElements'.
* Remove conditionals around data providing at initial run-time. Instead, expose
private method can call that. This way, we don't have two code paths claim
ownership over the namespace. And it makes the module easier to test and re-use
by not requiring the data to exist at first run time.
* Fix getDefinitionSummary() implementation to append data instead of setting
arbitary keys in parent data. ResourceLoader documentation of getDefinitionSummary()
has been updated to reflect this practice.
Change-Id: I40006d39514a997dce4930756a3dac84a0c9bb83
Move the XmlSelect class to its own file to make it easier to find
and utilize. Helps prevent the use of unnecessary
Html::openElement, Html::element, etc.
Bug: T93234
Change-Id: I66119a2d0eda15569de06c493a0ee302f21deb3f
* Split off OOjs UI's module definitions to a separate file from
Resources.php.
* Extend ResourceLoaderImageModule to support per-skin images and
variants.
* Allow skins to specify their preferred OOjs UI theme using new
skin registry attribute 'SkinOOUIThemes'. The default remains the
'mediawiki' theme, 'apex' can also be chosen now.
* Implement custom ResourceLoaderOOUIImageModule which implements some
special sauce required to shoehorn OOjs UI image set definitions into
ResourceLoaderImageModule with skin-specific styles support.
Bug: T100895
Change-Id: I3fbacbce95126a4cc29221352f3ef846f41e7b1b
Specifically, we export only those that are allowed to be paired,
because its parser doesn't handle self-closing tags.
Bug: T66740
Change-Id: I9944f9af915715c57a7d9ce3c62c3e61e54a75ba
Some of deleteArchivedFiles.php and deleteArchivedRevisions.php were
split off to deleteArchivedFiles.inc and deleteArchivedRevisions.inc
respectively in r62948 (04b2413aac) for use in tests.
The tests no longer use those methods, so I moved them back and inlined
them into execute(). I also did some minor cleanup -- changing direct
calls to tableName() and query() to use query builder functions and
clarifying/fixing some of the logic that was in deleteArchivedFiles.inc.
Change-Id: Ica49dcac18a9c702cffe02e562c6dff48d2d2784
This script is broken; it deletes an object cache key that 1.11
(r22850 / ed4303922f) and newer no longer use. The most similar
working script is probably refreshImageMetadata.php --force.
Change-Id: Icf2223dc87861e02f20422492d40994f5302ad15