| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Bug: T353458
Change-Id: I3e829e35c93bcaae75e401b1801bddf93c0b416c
|
|
|
|
|
| |
Bug: T353458
Change-Id: I2ae4577de79832b082adca282ff73cfabc8f9392
|
|
|
|
|
| |
Bug: T353458
Change-Id: I35864ad9bd48701703c51367d62f8ebde963c52d
|
|
|
|
|
|
|
|
| |
* Special:Block and Special:BlockList ignore restrictions if the page
has been removed. ApiQueryBlocks now matches that behavior
Bug: T388511
Change-Id: I525fbf73eec6f4a62bd6244b2a14e71130c7e602
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Add duration-l10n to BlockLogFormatter with a localized duration
string
* Add duration-l10n to ApiQueryBlocks
* Fix bug in Language::formatDurationBetweenTimestamps() which caused it
to be off by one hour if the specified timestamp straddled a daylight
savings boundary.
Bug: T388089
Change-Id: Ie88ca47053b2b9d6e3119aff5374e676d1835a44
|
|/
|
|
|
| |
Bug: T355722
Change-Id: Ica70fd7be1bd8f988d1d18c37d3571ab94256e3f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's about 100 callers of the DatabaseBlock constructor in core
tests, most of them passing an address parameter which needs access to
the global service container to parse.
Many are passing the constructed object straight to
DatabaseBlockStore::insertBlock(). So add insertWithParams() for their
convenience, which has some handy shortcut parameters, has service
access, and throws on failure. The calling code tends to be shorter
than before.
For unit tests trying to construct DatabaseBlock objects without a
service container, direct construction of BlockTarget subclasses is
warranted. Add a default to the $wikiId parameters for their
convenience.
MockBlockManager had its own 'target' parameter, mixed in with block
options, carrying its own special idea of a target, which conflicted
with DatabaseBlock's new 'target' parameter. Harmonise the parameters
and fix the callers.
Bug: T382106
Bug: T385966
Change-Id: I78b45a6003b62962211379c36da5587081f90f00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I noticed that the "confirmed" group was missing from the API result
on en.wikipedia.org. It is defined using $wgGroupInheritsPermissions,
not $wgGroupPermissions.
Rather than only using the latter, obtain lists of user groups and
granted permissions from UserGroupManager and GroupPermissionsLookup
respectively (and not just for filtering undefined groups out of the
lists of changeable groups).
Bug: T357846
Change-Id: I473868449dcf360afcba3c731ac7f282b623b1cd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* When requesting information about an action that will cause a
temporary user to be autocreated, permissions are checked
against a placeholder temporary account.
* Blocks are also checked against a placeholder temporary account,
meaning that blocks are not checked against the IP address and
other parts of the request object.
* This causes incorrect block information to be returned, e.g.
that there is no block when there is in fact a block against the
IP address.
* This is causing a bug in the mobile web editor, where the user
only gets notified that they are blocked from editing after they
submit the edit, instead of when the editor loads.
What:
* Check for blocks against the global session user in
ApiQueryInfo::extractPageInfo.
Bug: T357063
Change-Id: I942901f4f3a6845c2572623955e6a26d49954ca7
|
|
|
|
| |
Change-Id: I0f8a8cac36015bba52aea3ee2affd92f83d3574a
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a limit to the HideUserUtils subqueries to avoid error "Subquery
returns more than 1 row". We really want to know if at least one row
exists.
* Fix outdated doc comment
* Add tests.
Bug: T382399
Change-Id: Ib3bc22e0b3080b3ae6e1d2591ac7f2a1ef57c6b3
|
|
|
|
|
|
| |
Adds the equivalent of ApiCheckCanExecute for query modules.
Change-Id: I88effab746544c4788b607059a2184ead5b1bbac
|
|
|
|
|
|
|
|
|
|
|
| |
https://docs.phpunit.de/en/11.4/annotations.html#covers recommends:
> Please note that this annotation requires a fully-qualified class
> name (FQCN). To make this more obvious to the reader, it is
> recommended to use a leading backslash (even if this not required for
> the annotation to work correctly).
Change-Id: I7eb4b997346387e5799fa27a61ab317573124fd0
|
|
|
|
|
|
|
| |
setGroupPermissions() calls overrideConfigValue() for each config,
that is not needed and can be combined into one call
Change-Id: I5156b10c9df14773eaaf488d5bacfacd8846a80e
|
|
|
|
| |
Change-Id: I27b9a19ab952ede1267921bd042af0fe1c89e228
|
|
|
|
|
|
|
|
|
|
|
| |
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead
Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a
Break one long line in SpecialPage.php
Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
|
|
|
|
|
| |
Bug: T353458
Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
|
|
|
|
|
|
| |
Found via `[^*][^\\]\nclass_alias`.
Change-Id: I9732f75226445f48fb131c432b209d0fd3eba1ba
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* This change introduces two new optional parameters to the 'allusers'
API call named 'excludenamed' and 'excludetemp' that allows filtering
accounts based on whether they're named accounts or temporary
accounts. This is tested by using the temporary matchPattern
configured with $wgAutoCreateTempUser.
* User widgets that call 'allusers' have been updated so that
'excludenamed' and 'excludetemp' can be optionally set so that named
or temporary accounts may not returned with user suggestions.
Bug: T332030
Change-Id: I6563ae610017fd1cd35c36ba65906041f7f68c4b
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I48014b6464f3e7e2b7f083e67f517af0b1a9367e
|
|
|
|
| |
Change-Id: Id7ccd48e3bf626095e2d3929831b5d87ed0be948
|
|
|
|
|
|
|
| |
The main benefit is that this syntax avoids repeating the variable
name. It does the same as before.
Change-Id: I2040be889c749f4e2416ca9948ba261345858af2
|
|
|
|
|
| |
Bug: T353458
Change-Id: Id3202c0c4f4a2043bf97b7caee081acab684155c
|
|
|
|
|
| |
Bug: T353458
Change-Id: Ifa3b6a6e0353bb4ce21a3f4456f1fc696c8d377c
|
|
|
|
|
|
|
| |
It adds MediaWiki\Content namespace to WikitextContent
and two classes related.
Change-Id: Ib74e4c5b3edac6aa0e35d3b2093ce1d0b794cb6d
|
|
|
|
|
|
|
|
|
|
|
|
| |
Edits from temporary accounts are considered anonymous edits.
ApiQueryRecentChanges doesn't correctly reflect this and needs to be
updated to correctly return temporary account edits as anonymous (and
similarly, not to return them when requesting !anon)
- Update the anon|!anon query to accomodate temporary accounts
Bug: T370803
Change-Id: Ica5225422ea53d2aa3a84b86d9c2f14832a34ed4
|
|
|
|
|
|
|
|
|
|
|
| |
Replace uses of soon-to-be-deprecated methods:
* ApiBase::errorArrayToStatus
* PermissionStatus::toLegacyErrorArray
Deprecate and replace uses of:
* RecentChange::doMarkPatrolled
Change-Id: I2311d1fa3772ba6be378ad6f497ed4c0df9b7aa8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- The test class does anonymous edits, but did not first disable temp
user creation
What:
- Disable temp user creation before attempting an anonymous edit
- Enable temp account feature when calling doTempPageEdit
- Remove call to enableAutoCreateTempUser in testShowAnonParamsTemp, as
it's no longer needed
Bug: T365669
Change-Id: I2ce83d5703ecc75fe680d7ddb44aa406c26c4df5
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- This test exercises code that checks for IP edits
What:
- Disable temp user feature for this test class
Bug: T365669
Change-Id: If385b71b76c16f9276c3973a02ca0c888b47d3a3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- This test does not pass when temp accounts are enabled
What:
- Set disableAutoCreateTempUser when doing an anon page edit
- Set a valid pattern for the temp user name
This patch does not fix testUserPropParameter but does solve the other
failures for this class.
Bug: T365669
Change-Id: I24b3ff10c6275a9c13c3f07d97ea14581f975067
|
|
|
|
|
| |
Bug: T316841
Change-Id: I29e535e8ee9b5641a4546d53b98cd5060d39681d
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For a deduplication the raw sql is used as string key in an array.
Now only the search term is part of the key, build the sql a bit later,
as objects not usable in array keys.
The deduplication is needed when namespaces have different first letter
configs as happen with $wgCapitalLinks = false for all namespaces except
the hard coded like user and mediawiki with talk.
Searching for lower case titles splits the query
Bug: T361023
Change-Id: Ia4e29d1d4d816f354318ef443ae19c954fd52274
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Why:
- Using TempUserConfig is more flexible as it doesn't require us to know
about the internal details of the AutoCreateTempUser config object
What:
- Use TempUserConfig service instead of loading the AutoCreateTempUser
object
- Remove properties from ApiQuerySiteInfo that don't already have
getters. If someone has a need for more this information to be exposed
in ApiQuerySiteInfo, they can be added in a separate patch
- This seems compatible with the goals of T335532 which was about
making it possible to discover via the API if an action would result
in a temp account
- Implement __toString for Pattern, so that it can be used in
ApiQuerySiteInfo
Bug: T335532
Change-Id: Ica84b3e9b9865b8b83a9e9e513c99cd2e47661c9
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- Consistency with the enableAutoCreateTempUser method
- Allows for overriding config properties (e.g. 'known')
What:
- Use an array as the parameter for `disableAutoCreateTempUser` instead
of a string
Change-Id: I1a495cc83effcf92364fa489f779c5f4bf2d29b9
|
|
|
|
|
|
|
|
|
| |
This patch introduces a namespace declaration for the
MediaWiki\Watchlist to WatchedItemQueryService and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: Ib1b5c19c89087940987730939e84c8cd35cd3760
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Deprecate and stop using $wgBlockTargetMigrationStage. Remove
block_target migration code.
* Make the $schema parameters to DatabaseBlockStore methods default to
SCHEMA_BLOCK. Avoid passing these parameters where possible.
* Remove cleanupBlocks.php
* Deprecate DatabaseBlock static methods which try to present the old
schema for b/c.
Bug: T362133
Change-Id: I845bad8cc09a4528fef46a6f9d490ebdec881d99
|
|/
|
|
|
|
| |
Not sure why I added these, it should be clear from the method names
Change-Id: Ie49881e6f31fad52bb65b0d2ac3e9379dbb7bfc5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A number of tests have hardcoded expections that pass only in WMF CI
where Quibble has LocalSettings.php with $wgScript and $wgArticlePath
set a certain way.
We could fix these by adding setMwGlobals() in their tests, as we
often do, but these are so often forgotten that I'd rather we just
add them to TestSetup.php so that it is simply impossible to write a
test that that passes locally for you (if you have the same config)
but not for someone else.
There is a larger project in there somewhere about expanding this
slowly such that we basically only pluck DB-settings and extension
enablement from LocalSettings and otherwise run the tests with the
default settings in PHPUnit. Pretty much by definition, any (other)
setting you have in LocalSettings is irrelevant because it either:
1. has no effect on the test (majority, harmless either way),
2. has a custom default via TestSetup.php (which has precedence over
LocalSettings.php),
3. is relevant to the code being tested and the test case correctly
calls setMwGlobals() to ensure a consistent value during test.
4. is relevant to the tested code but has no override, thus only
passes if you happen to have the "right" value set for it
(undesirable).
Case 4 is already categorically impossible for the most common config
settings that influence random code because we give them a value
in TestSetup.php. This patch expands that to include $wgScript
and $wgArticlePath. Perhaps in the future we can think about a way
to do this automatically by either re-applying MainConfigSchema
(sans db settings) or by only selectively applying LocalSettings.php
in the first place.
This patch follows-up I072ddf89562fe, which added a test case in
WikitextContentHandlerIntegrationTest.php that assumed "/index.php"
as the value of $wgScript. This passes in WMF CI since Quibble uses
that value, but the tests failed in most local development installs
since those tend to use "/w" instead.
Rather than one-off fixing that one test with overrideConfigValues(),
switch to a more general fixture, since the precise values don't
matter for this test.
Bug: T349087
Bug: T277470
Change-Id: If4304b7ca4a838bd892d4516a0b5c6dfbc30986e
|
|
|
|
| |
Change-Id: I36cb706acc745a082b6fd90a55b859f24ed35eb9
|
|
|
|
|
|
|
|
| |
Production is read new almost everywhere, mediawiki core should reflect
that as well.
Bug: T299947
Change-Id: I8f05c4d7026394205bfc54b68dc725392852ae2a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- We don't want to allow unlimited acquisition of temp account names.
These should be rate limited in similar way to how we limit the
creation of temp accounts
What:
- Provide a TempAccountNameAcquisitionThrottle, and use it in the
acquireName() method
- Set a default that is 10 times the limit of
TempAccountNameCreationThrottle
Depends-On: If660aad1d0f04f366414084aff3f88484a19d416
Bug: T343101
Change-Id: I99d5973498a89ac227847de5837c0a8e895c28fb
|
|
|
|
|
|
|
|
| |
Fix the real issues found by this sniff, and convert the remaining
false positive ignores to per-line ignores so that any more real issues
won't be added.
Change-Id: I18e75d59df327e2d93a3a487c115e92b9f268722
|
|
|
|
|
|
|
|
|
| |
Changed some inserts to use multi-row insert for small performance
benefit where possible and not already used.
InsertQueryBuilder does not return a value, deprecated since 1.33
Bug: T353219
Change-Id: I2380ebc8ec8db178dd790247aefbdd798b6d62ff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* ApiQueryBase subclasses may define a ::isWriteMode override, as
the API call may need to write to the DB.
** This is the case for the CheckUser extension, where the
'checkuser' API creates a log entry that allows users to audit
usage of the API.
* ApiQuery currently does not define a implementation of
::isWriteMode, which means that the definitions by any class
that extends ApiQueryBase currently do nothing.
* ApiQuery::isWriteMode should be defined and work in a similar
way to ApiQuery::isReadMode, so that subclasses of ApiQueryBase
can have their definitions of ::isWriteMode respected.
What:
* Define ApiQuery::isWriteMode in a similar way to how ApiQuery
::isReadMode is written, but also inspecting the modules that
are used through the 'list' and 'prop' params.
* Add tests for ApiQuery::isWriteMode.
Bug: T361951
Change-Id: Idf1c8f95df58a861404e0c89507c885ec4554793
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* The default value of wgAutoCreateTempUser has not changed since
the decision to use a different prefix for temporary accounts
(T332805).
* The default needs to be updated to reduce the number of overrides
in operations/mediawiki-config and also to make the development
experience more consistent with what is happening on WMF
production.
What:
* Update the wgAutoCreateTempUser default in the following ways:
** Set expireAfterDays as 365
** Set notifyBeforeExpirationDays as 10
** Set genPattern and reservedPattern to '~$1'
** Set matchPattern to null, which will mean that the genPattern
is used as the value.
* Update RealTempUserConfig::getPlaceholderName to add the year to
the placeholder name so that if the match pattern includes the
first digit of the year, then the placeholder name still is
considered a valid temporary account username.
* Replace modifications of the wgAutoCreateTempUser config in
integration tests with a use of the TempUserTestTrait to make
the code cleaner and make it easier to find tests that relies on
the values in wgAutoCreateTempUser.
* Update multiple tests to handle the new defaults for the config.
Bug: T359335
Change-Id: Ifa5a0123cd915bdb7c87e473c51fb93321622f12
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a comment explaining why we need table aliases in HideUserUtils
subqueries.
* Use the table aliases consistently in inner field references. While
this does not appear to be strictly necessary, since unprefixed fields
refer to the inner query by default, it helps to improve the clarity
of the code.
Change-Id: Id68684ea12060a259dc87e66edd63b925da2c3b1
|
|
|
|
|
|
|
|
|
|
|
| |
On en.wikipedia.org, MariaDB chooses to materialize the subquery,
copying about 810,000 rows to a temporary table.
So, use a dependent scalar subquery, which is not eligible for this
"optimisation".
Bug: T360163
Change-Id: I7819a6870871687ea96f92dfd3f8fe581b54cc24
|