wiki.techinc.nl/includes
Brad Jorsch 96bd79b4a3 Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames
Importing revisions in MediaWiki has long been weird: if the username on
the imported revision exists locally it's automatically attributed to
the local user, while if the name does not exist locally we wind up with
revision table rows with rev_user = 0 and rev_user_text being a valid
name that someone might later create. "Global" blocks too create rows
with ipb_by = 0 an ipb_by_text being a valid name.

The upcoming actor table change, as things currently stand, would
regularize that a bit by automatically attributing those imported
revisions to the newly-created user. But that's not necessarily what we
actually want to happen. And it would certainly confuse CentralAuth's
attempt to detect its own global blocks.

Thus, this patch introduces "interwiki" usernames that aren't valid for
local use, of the format "iw>Example".[1] Linker will interpret these
names and generate an appropriate interwiki link in history pages and
the like, as if from wikitext like `[[iw:User:Example]]`.

Imports for non-existant local users (and optionally for existing local
users too) will credit the edit to such an interwiki name. There is also
a new hook, 'ImportHandleUnknownUser', to allow extension such as
CentralAuth to create local users as their edits are imported.

Block will no longer accept usable-but-nonexistent names for 'byText' or
->setBlocker(). CentralAuth's global blocks will be submitted with an
interwiki username (see Ieae5d24f9).

Wikis that have imported edits or CentralAuth global blocks should run
the new maintenance/cleanupUsersWithNoId.php maintenance script. This
isn't done by update.php because (1) it needs an interwiki prefix to use
and (2) the updater can't know whether to pass the `--assign` flag.

[1]: '>' was used instead of the more usual ':' because WMF wikis have
many existing usernames containing colons.

Bug: T9240
Bug: T20209
Bug: T111605
Change-Id: I5401941c06102e8faa813910519d55482dff36cb
Depends-On: Ieae5d24f9098c1977447c50a8d4e2cab58a24d9f
2017-11-30 13:12:44 +11:00
..
actions Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
api Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames 2017-11-30 13:12:44 +11:00
auth SECURITY: Do not reveal if user exists during login failure 2017-11-15 00:58:44 +00:00
cache Revert "Remove some remaining mentions of unstubbing from core" 2017-10-05 17:27:08 +00:00
changes Use WANObjectCache::makeKey() in ChangesFeed 2017-11-27 12:03:47 -08:00
changetags Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
clientpool
collation Add Unicode to ICU mappings for versions 58 and 59 2017-10-25 23:42:28 +01:00
compat Improve some parameter docs 2017-09-10 20:32:31 +02:00
composer SECURITY: Create a .htaccess in /vendor after composer runs 2017-11-15 02:54:30 +00:00
config Improve some parameter docs 2017-09-10 20:32:31 +02:00
content Make $mText an explicit member variable in TextContent 2017-10-11 18:05:49 +00:00
context build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 2017-09-25 17:31:56 +02:00
dao Use short type bool/int in param documentation 2017-08-20 13:20:59 +02:00
db Use the main stash for LBFactory "memStash" parameter 2017-11-10 00:31:08 +00:00
debug Improve some parameter docs 2017-09-10 20:32:31 +02:00
deferred Add action/user tracking to html cache purge jobs 2017-10-30 10:47:30 -07:00
diff Fix regex on diff tooltips 2017-11-22 11:51:43 +01:00
edit Return a typed object from WikiPage::prepareContentForEdit 2017-07-19 06:24:39 +00:00
editpage EditPage: Extract some edit conflict code into EditConflictHelper 2017-10-26 10:32:29 +02:00
exception Merge "MWExceptionRenderer: Wrap error message in a paragraph" 2017-11-15 10:38:43 +00:00
export Run strval() over the File description 2017-09-18 01:00:10 +01:00
externalstore Introduce ExternalStoreFactory 2017-11-14 13:22:12 +00:00
filebackend Replace MimeMagic::singleton() calls 2017-11-27 02:13:51 +00:00
filerepo Replace MimeMagic::singleton() calls 2017-11-27 02:13:51 +00:00
gallery Add missing & to @param documentation to match functon call 2017-08-11 18:47:46 +02:00
htmlform Merge "OOUIHTMLForm: Prevent duplicate FieldsetLayout wrapping" 2017-11-16 17:31:45 +00:00
http Remove @codingStandardsIgnore from long lines 2017-10-22 16:44:04 +02:00
import Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames 2017-11-30 13:12:44 +11:00
installer Added new success message when CLI Installer completes its work succesfuly. 2017-11-29 22:44:55 +00:00
interwiki Fix return of Interwiki::invalidateCache 2017-09-10 00:17:26 +02:00
jobqueue Merge "Introduce ClearUserWatchlistJob" 2017-11-28 18:31:52 +00:00
json
libs Merge "Disallow setting DBO_IGNORE in Database for sanity" 2017-11-29 21:54:15 +00:00
linkeddata build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0 2017-06-26 17:14:31 +00:00
linker Add __toString method to LinkTarget interface 2017-11-18 20:23:21 +00:00
logging Fix undefined $db 2017-11-29 00:21:59 +00:00
mail Cleanup, removed space 2017-11-02 13:54:05 +01:00
media Replace MimeMagic::singleton() calls 2017-11-27 02:13:51 +00:00
objectcache Add statsd metric support to WANObjectCache 2017-10-25 01:41:31 +00:00
page Handle case when there is no handler for a file 2017-11-27 09:44:19 +00:00
pager Replace uses of each() 2017-09-20 09:51:28 -04:00
parser {{anchorencode:}} output should be always usable in links 2017-11-21 16:42:35 -05:00
password Improve test coverage in includes/password 2017-06-07 14:28:11 +10:00
poolcounter Avoid using the deprecated ParserCache::singleton() 2017-09-09 14:20:10 -07:00
profiler Merge ProfilerFunctions into GlobalFunctions 2017-11-09 16:31:55 -08:00
rcfeed Merge "Fix a few minor mistakes in PHPDoc tags" 2017-09-15 19:18:17 +00:00
registration Merge "registration: Only allow one extension to set a specific config setting" 2017-10-24 17:52:23 +00:00
resourceloader Increase Opera minimum for Grades A and C to 15 2017-11-29 02:40:27 +00:00
revisiondelete Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
search Merge "Fix a few minor mistakes in PHPDoc tags" 2017-09-15 19:18:17 +00:00
services Use short type bool/int in param documentation 2017-08-20 13:20:59 +02:00
session build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 2017-09-25 17:31:56 +02:00
shell Shell: skip null parameters 2017-11-29 12:38:35 -08:00
site Improve some parameter docs 2017-09-10 20:32:31 +02:00
skins Provide message/warning/error box abstraction 2017-11-13 23:19:45 +00:00
specialpage Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
specials Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames 2017-11-30 13:12:44 +11:00
templates Merge "RCFilters: Add marker between old and new changes in enhanced mode" 2017-08-17 05:56:42 +00:00
tidy Fix RemexCompatMunger infinite recursion 2017-11-17 23:27:14 +11:00
title Deprecate access to TitleValue properties 2017-11-20 19:03:06 +00:00
upload Replace MimeMagic::singleton() calls 2017-11-27 02:13:51 +00:00
user Introduce the UserIdentity interface. 2017-11-18 19:47:25 +00:00
utils Replace MimeMagic::singleton() calls 2017-11-27 02:13:51 +00:00
watcheditem Introduce ClearUserWatchlistJob 2017-11-28 17:11:40 +00:00
widget Fix wrong variable in ShowSearchHit call. 2017-11-07 16:33:38 -08:00
.htaccess
AjaxDispatcher.php Improve some parameter docs 2017-09-10 20:32:31 +02:00
AjaxResponse.php
AuthPlugin.php Add missing @param and @return documentation 2017-08-11 22:17:01 +02:00
AutoLoader.php
Autopromote.php In Autopromote skip edit count lookup if requirement is 0 or invalid 2017-05-21 14:30:42 +00:00
Block.php Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames 2017-11-30 13:12:44 +11:00
CategoriesRdf.php Produce RDF dump of all categories and subcategories in a wiki. 2017-08-28 00:30:35 -07:00
Category.php Use short type bool/int in param documentation 2017-08-20 13:20:59 +02:00
CategoryFinder.php Replace more uses of "SELECT *" 2017-10-13 19:02:56 +00:00
CategoryViewer.php Fix inconsistent i18n escaping in category paging links. 2017-10-11 20:29:05 +00:00
CommentStore.php Have CommentStore limit the maximum character length of comments 2017-10-10 20:59:52 -04:00
CommentStoreComment.php build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 2017-09-25 17:31:56 +02:00
ConfiguredReadOnlyMode.php Split ConfiguredReadOnlyMode into own file 2017-08-07 09:24:19 +00:00
DefaultSettings.php Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames 2017-11-30 13:12:44 +11:00
Defines.php Document DB_SLAVE as deprecated 2017-09-06 18:09:42 -07:00
DeprecatedGlobal.php DeprecatedGlobal: Support lazy-loading via StubObject 2017-07-05 19:55:00 -07:00
DerivativeRequest.php
DummyLinker.php
EditPage.php Remove htmlspecialchars for Html::hidden 2017-11-09 17:08:57 +01:00
EventRelayerGroup.php Remove "@author Aaron Schulz" annotations 2017-06-27 15:24:14 -07:00
FauxRequest.php Add missing @param and @return documentation 2017-08-11 22:17:01 +02:00
Feed.php Replace MimeMagic::singleton() calls 2017-11-27 02:13:51 +00:00
FeedUtils.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
FileDeleteForm.php Add missing & to @param documentation to match functon call 2017-08-11 18:47:46 +02:00
ForkController.php
FormOptions.php Improve some parameter docs 2017-09-10 20:32:31 +02:00
GitInfo.php shell: Optionally restrict commands' access with firejail 2017-11-28 00:06:40 +00:00
GlobalFunctions.php Expose string->bool conversion as function 2017-11-15 06:57:40 +00:00
HeaderCallback.php
HistoryBlob.php Add lowercase variants to the autoloader for legacy history blob classes 2017-10-16 13:56:35 +00:00
Hooks.php Hooks: Introduce Hooks::runWithoutAbort() alongside Hooks::run() 2017-09-04 18:55:42 +00:00
Html.php Add unit tests for Html helper methods and change messageBox visibility 2017-11-21 21:11:28 +00:00
HtmlFormatter.php
Linker.php Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames 2017-11-30 13:12:44 +11:00
LinkFilter.php build: Update mediawiki/mediawiki-codesniffer to 0.10.1 2017-07-22 18:24:09 -07:00
ListToggle.php ListToggle: Avoid href="#" for JavaScript buttons 2017-08-01 22:57:45 +02:00
MagicWord.php Updated type and function docs for MagicWord.php 2017-10-02 13:52:51 +02:00
MagicWordArray.php Replace uses of each() 2017-09-20 09:51:28 -04:00
MediaWiki.php OutputPage: Hard-deprecate setSquidMaxage, renamed since 1.27 2017-11-02 11:51:58 -07:00
MediaWikiServices.php Split interface from WatchedItemStore 2017-11-14 19:27:03 +01:00
MediaWikiVersionFetcher.php
MergeHistory.php Use short type bool/int in param documentation 2017-08-20 13:20:59 +02:00
Message.php SECURITY: Ensure Message::rawParams can't lead to XSS 2017-11-15 02:36:48 +00:00
MimeMagic.php Add wfDeprecated() call to MimeMagic::singleton() 2017-11-27 02:20:17 +00:00
MovePage.php Replace more uses of "SELECT *" 2017-10-13 19:02:56 +00:00
MWGrants.php
MWNamespace.php Improve namespace handling in tests 2017-09-29 05:21:47 +00:00
MWTimestamp.php
NoLocalSettings.php Setup: Merge PreConfigSetup into Setup.php 2017-10-24 23:50:54 +00:00
OrderedStreamingForkController.php Improve some parameter docs 2017-09-10 20:32:31 +02:00
OutputHandler.php Remove empty lines at begin of function, if, foreach, switch 2017-07-01 11:34:16 +00:00
OutputPage.php Deprecate OutputPage::parserOptions() as a setter 2017-11-22 15:17:00 -05:00
PageProps.php Only do one query for page ids in PageProps::getGoodIDs 2017-08-30 20:32:19 +02:00
PathRouter.php
PHPVersionCheck.php Prepare for 1.31 branch 2017-09-19 11:34:47 -07:00
Pingback.php Improve some parameter docs 2017-09-10 20:32:31 +02:00
Preferences.php Preferences: Don't show the watchlist token; just link to ResetTokens 2017-11-20 23:53:16 +00:00
PrefixSearch.php
ProtectionForm.php Add missing & to @param documentation to match functon call 2017-08-11 18:47:46 +02:00
ProxyLookup.php
RawMessage.php Move RawMessage out of Message.php to its own file 2017-08-14 17:33:52 +00:00
ReadOnlyMode.php Split ConfiguredReadOnlyMode into own file 2017-08-07 09:24:19 +00:00
Revision.php WikiPage::doModify: Reuse old revision while null-editing 2017-11-04 00:54:18 +00:00
RevisionList.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ServiceWiring.php shell: Optionally restrict commands' access with firejail 2017-11-28 00:06:40 +00:00
Setup.php Setup: Include StartProfiler before others 2017-11-09 16:35:19 -08:00
SiteConfiguration.php Do not limit filesize when running a maintenance script 2017-11-14 20:45:24 +11:00
SiteStats.php Use short type bool/int in param documentation 2017-08-20 13:20:59 +02:00
Status.php Revert "Stop stubbing StubUserLang" 2017-10-05 16:52:49 +00:00
StreamFile.php Replace MimeMagic::singleton() calls 2017-11-27 02:13:51 +00:00
StubObject.php Add missing & to @param documentation to match functon call 2017-08-11 18:47:46 +02:00
TemplateParser.php Enable recursive partials in TemplateParser 2017-09-10 05:51:07 +00:00
TemplatesOnThisPageFormatter.php
Title.php Merge "Add action/user tracking to html cache purge jobs" 2017-11-09 22:33:48 +00:00
TitleArray.php
TitleArrayFromResult.php
TrackingCategories.php Add @since tag to TrackingCategories class 2017-08-07 09:24:07 +00:00
WebRequest.php
WebRequestUpload.php
WebResponse.php
WebStart.php WebStart: Remove use of realpath() for $IP 2017-11-29 21:51:44 +00:00
WikiMap.php Clean up wiki ID and DB domain ID handling 2017-09-30 10:25:03 +00:00
WikiReference.php Move some more classes to comply with class per file 2017-05-21 13:23:31 +01:00
Xml.php Revert "Xml: Fix Xml::fieldset() when $content is not given" 2017-09-17 19:25:01 +02:00
XmlJsCode.php Fix a few minor mistakes in PHPDoc tags 2017-09-15 11:17:17 +02:00
XmlSelect.php