User "0", page "0" and edit summary "0" are all valid.
Treating them as empty may cause subtle inconsistencies.
Change-Id: I90a92bfb972cca840e5d8060dac3f116a22990db
Why:
* Before this task, when an API parameter specifies allowed user
types, temporary users and permanent users are in the same
category: 'name'.
* However, it is useful to separate them out, and sometimes
allow a permanent user but not a temporary user (e.g.
ApiResetPassword, since temporary users don't have passwords).
* We therefore re-defined the 'name' type only to refer to
permanent (named) users, and add a new 'temp' type.
* This fixes params that currently intend to allow temp users,
and that use 'name' to do so, by adding 'temp'.
What:
* Based on a search for `UserDef::PARAM_ALLOWED_USER_TYPES`,
add the 'temp' type where necessary.
* The following were not updated, because they shouldn't apply
to temporary users:
- owners for includes/api/ApiQueryWatchlist.php,
includes/api/ApiQueryWatchlistRaw.php
- users for includes/api/ApiResetPassword.php,
includes/api/ApiUserrights.php,
includes/api/ApiValidatePassword.php
Bug: T350701
Change-Id: If5ccf1d469327791acff74d013343307e411cca9
Deprecating RevisionStore::getQueryInfo() and cleaning up a lot of code
Also removing a brittle test that wasn't really testing anything.
Bug: T344971
Change-Id: Ifd690dc8f030f86e3567a717eaeb830cb6dc703b
Mostly used find-and-replace:
Find:
/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|)
Replace with:
\3 \1 \4
Followed by some manual review to make sure I'm not changing too much,
omitting some changes that looked too complicated and anything that
caused test failures, and some whitespace fixes.
Change-Id: Ie78be1c614985d7c2964156e454cc9266515dc18
Easier to translate
There is no visible change for example on
Special:ApiHelp/query+watchlist
Bug: T285545
Change-Id: I536fa3e07a951f3ff98870678ffdbc294a3c7bc0
The currently supported groups are documented in database.md.
While at it, prefer the string form of the $groups parameter where
possible, since the complexity of an array is never utilized, as the
groups either can't overlap, or are decided on by the caller instead.
This also helps with the simpler LBFactory::getConnection() proposed
in T326274.
Bug: T263127
Bug: T326274
Change-Id: I7a31a07a8c3f1e265ac43ab59f23326590b407c3
so that extensions (i.e. CheckUser) can implement their own comment
store without having a lot of code duplication
basically the comment store version of I3a6486532f2ef36
Bug: T233004
Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd
This may seem a bit weird but anything else related to actor is already
under user/ including ActorCache, ActorNormalization, ActorStore and
ActorStoreFactory.
Bug: T321882
Change-Id: I7072b374bba7a0cd9d905e399c822bf30bd5c0d8
When using the 'userids' or 'user' parameters, $this->orderBy would
previously be set to (respectively) 'id' or 'name'.
This was confusing, because:
* If more than 1 user ID/name was requested, it was immediately
overwritten to 'actor' by the code below.
* If only 1 user ID/name was requested, it was not used for building
either the continuation string or the database query.
Set it to 'actor', and remove code generating and parsing the unused
continuation modes (note that 'name' is still used with other
parameters). Also rename a variable called `$fromName` that actually
always contained an actor ID and not a user name (resolving a FIXME).
Follow-up to c29909e59f, which removed
the code paths that used 'id' or 'name' continuation modes for paging
by user_id and user_name.
Change-Id: I9570292beaa7dca0dbc165ab319b9eef42712efa
30+ API modules had nearly identical code to split and validate
the value of the 'continue' parameter.
Introduce the ApiBase::parseContinueParamOrDie() method and use it to
replace most usages of ApiBase::dieContinueUsageIf(). A few remain in
modules with more complex continuation handling.
Inline most single-use variables that remained after validation was
moved into the new method.
Change-Id: I66bd59ecd4ad16e2039e90f7d66cfa276e6c1c2a
See ec79aa3943 about the new method.
These changes all follow the same simple patterns. More complex cases
are handled in I6231b6beae13474d4986929367a9adc6bb76b0db.
This commit was created by running the following terrible Ruby script
I devised: https://phabricator.wikimedia.org/P34833, then manually
reviewing the results: checking that the output makes sense in general,
that the affected variables are not used elsewhere in the file, and
that no comparison conditions have been lost. A few incorrect changes
were undone or corrected.
Change-Id: I8ed363bd6b80a9481d44434a526f078cce20220f
The variables are set conditional later, but all condition branches set
it or the variable is not used outside that scope
Change-Id: Ic9612915db507028ad4733a061d3ce9be3babfb6
Do the same forcing as already done in Special:Contribs
(from bac54c2 and 9c09511)
The default query for list=usercontribs&ucuser=*&ucnamespace=* for a
namespace with a small number of edits shows filesorting under EXPLAIN
Bug: T307815
Change-Id: I2c8577b0711f6cd19fd062dd19c7263338ab923d
This works by using the ip_changes table.
`iprange` parameter is introduced in order to restrict input to only one range.
Result is sorted by name, timestamp similar to `userprefix` parameter,
and T180153 (sort by timestamp first) is not addressed.
Related messages and test cases are added.
Bug: T177150
Change-Id: I3b8a917aaa76e18decf85b621dc77799698e4a77
This covers all occurrences of /onfig->.*get( '/ in includes/.
Undoubtedly there are still plenty more to go.
Change-Id: I33196c4153437778496f40436bcde399638ac361
Make phan stricter about conditional variable declaration
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T259172
Change-Id: I1f200ac37df7448453688bf464a8250c97313e5d
These special pages and their counter-part APIs are:
- Special:RecentChanges
- Special:Watchlist
- Special:Log
- Special:Contributions
This also changes the way MAX_EXECUTION_TIME works from taking the value
as milliseconds, it takes seconds which is more intuitive for users.
Bug: T297708
Depends-On: I126e7181422d8da1a63afc3717faa4f72a687dd9
Change-Id: I3ff78751c3df3b6342f1865d35c2075f4415185d
The database result is always a string, cast to int before passing to
getRevisionSizes, which is documented to take int[]
Change-Id: Iead5787a596e0264b769a97f1c79c1abe5c482f4
Introduce a new schema migration stage in which rev_actor is used
directly and the revision_actor_temp table is no longer needed. This
becomes the new "new" stage whereas the previous situation is now
termed SCHEMA_COMPAT_TEMP.
Introduce migrateRevisionActorTemp which copies data from
revision_actor_temp to rev_actor. The code is similar to
migrateImageCommentTemp.php except that it doesn't delete from the old
table.
Partial revert of c29909e59f. That change removed direct
references to $wgActorTableSchemaMigrationStage and made queries
involving revision_actor_temp be unconditional. Such changes need to be
reverted to make the use of revision_actor_temp be conditional again.
In ActorMigrationTest, I compacted provideGetJoin() and
provideGetWhere(), removing most of the duplication between expected
values. I gave all the stages a short name, and mostly used the name in
providers.
Bug: T275246
Change-Id: I7498107dd6433ab7de5bf2e7b3fe2aa5e10e345d
array_fill_keys() was introduced in PHP 5.2.0 and works like
array_flip() except that it does only one thing (copying keys) instead
of two things (copying keys and values). That makes it faster and more
obvious.
When array_flip() calls were paired, I left them as is, because that
pattern is too cute. I couldn't kill something so cute.
Sometimes it was hard to figure out whether the values in array_flip()
result were used. That's the point of this change. If you use
array_fill_keys(), the intention is obvious.
Change-Id: If8d340a8bc816a15afec37e64f00106ae45e10ed
This reverts commit ecf826a2ee.
Reason for revert: need to edit the patch and then it will be GTG in order to finish hard deprecating of User ::getCanonicalName, ::isUsableName, ::isCreatableName
Change-Id: I2f57f56728fcbeada96dc2228f07dc8bcaa5d4f6