| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
As much as possible
Bug: T330641
Change-Id: Icb943d6d65b210760ba8966419327c9603e768e0
|
|/
|
|
|
|
|
|
|
|
|
| |
Various tools want to display the full HTML error messages
when &errorformat=html&errorsuselocal=1 is specified.
Depends-On: I06c89534be605557ee9b0d90d2748f806fa2ae9e
Depends-On: I353e34d81afaa06750f8725181c808fabcebea42
Depends-On: Ib60ac795e9dda124b927816321aafe0853ee4500
Bug: T335319
Change-Id: Ie17987991d1e9a0d77da97e3a81fe0a21c6d7866
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no way to express that Title::castFromPageIdentity(),
Title::castFromPageReference() and Title::castFromLinkTarget()
can only return null when the parameter is null. We need to add
Phan suppressions or explicit types almost everywhere that these
methods are used with parameters that are known to not be null.
Instead, introduce new methods Title::newFromPageIdentity() and
Title::newFromPageReference() (Title::newFromLinkTarget() already
exists), without the null-coalescing behavior, and use them when
the parameter is not null. This lets static analysis tools, and
humans, easily understand where nulls can't appear.
Do the same with the corresponding TitleFactory methods.
Change the obvious uses of castFrom*() to newFrom*() (if there is
a Phan suppression, a type check, or a method call on the result).
Change-Id: Ida4da75953cf3bca372a40dc88022443109ca0cb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is moderately messy.
Process was principally:
* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
xargs rg --files-with-matches 'Title\b' | \
xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix
Then manual fix-ups for a few files that don't have any use statements.
Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow the use of PARAM_HELP_MSG_PER_VALUE for PARAM_TYPE='string'
and PARAM_ISMULTI=true, which is the setting used for templated
parameters (PARAM_TEMPLATE_VARS).
It's common for templated parameters to take the variable parts
of the name from some fixed set, but they are required to use
PARAM_TYPE=string so it makes sense to allow the use of multi-
valued parameter documentation for that case.
The other option would have been to allow templated parameters
to be enums, which also makes sense and could be a complimentary
improvement; there are two reasons to prefer the current approach:
* Getting the list of allowed values might have a performance
impact that we only want to incur when the (optional) parameter
is used, while an enum requires the value list to be generated
every time the API module is used. So there would be some
value in using string type for templated parameters with a
known set of documentable values even if enum were also allowed.
* Per-value documentation might be useful outside the template
use case for non-restricted multi-valued strings: maybe all
values are allowed but there are some values with special
meanings that are worth documenting.
Change-Id: I53f9ae840c0a7eee76c4b57f95390b5045707efd
|
|
|
|
|
|
|
|
|
|
| |
To follow Message. This is approved as part of RFC T166010.
Also namespace it but doing it properly with PSR-4 would require
namespacing every class under language/ and that will take some time.
Bug: T321882
Change-Id: I195cf4c67bd51410556c2dd1e33cc9c1033d5d18
|
|
|
|
|
|
|
|
|
|
| |
The motivation is to make the code less confusing. I hope this is the
case.
?? is an older PHP 7.0 feature.
??= was added in PHP 7.4, which we can finally use.
Change-Id: Id807affa52bd1151a74c064623b41d950a389560
|
|
|
|
|
| |
Bug: T321265
Change-Id: Ib46bc3e643938f56e0c58a3c5f5e093327e00964
|
|
|
|
|
|
|
|
| |
Introduced in PHP 7.1. Because it's shorter and looks nice.
I used regex replacement.
Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
|
|
|
|
|
|
|
|
| |
This patch only adds and removes suppressions, which must be done in the
same patch as the version bump.
Bug: T298571
Change-Id: I4044d4d9ce82b3dae7ba0af85bf04f22cb1dd347
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly, document some parameters as non-empty-array so that phan knows
the list of arguments won't be empty when unpacking.
In EditPage, account for hooks potentially unsetting the copyright
notice.
Also rewrite some code in LogPager, so it's hopefully easier for phan to
understand what's going on.
Change-Id: Ic0638571554424098d0743db32dd46723a08e103
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I1f20597093448d00435158a9ac861873000bb057
|
|
|
|
| |
Change-Id: I1d9d62d80b17d1a05222c6e82f631cb801c311a8
|
|
|
|
|
| |
Bug: T311544
Change-Id: I4fd4557dbac889175eef4582fa57f6f2274f3a69
|
|
|
|
|
| |
Bug: T297688
Change-Id: I5537bd615484bf3a9eb5b597121fa4881c1a5961
|
|
|
|
|
| |
Bug: T283978
Change-Id: I49f8c7bf1162dc834a1708e2e581f6fb264bbd0a
|
|
|
|
|
|
|
|
|
| |
self::$filterIDsCache caches database state, it gets out of whack when
we reset the database between test cases.
The cache was originally introduced to fix T140302.
Change-Id: I9a05c60d84d92f6798154bfa77c6288576dc53bc
|
|
|
|
| |
Change-Id: I498a315b8b4b56d5e2f939e797adbe0487cd7d07
|
|
|
|
| |
Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
|
|
|
|
|
|
|
| |
This covers all occurrences of /onfig->.*get( '/ in includes/.
Undoubtedly there are still plenty more to go.
Change-Id: I33196c4153437778496f40436bcde399638ac361
|
|
|
|
|
|
|
|
|
|
|
| |
Make phan stricter about array keys
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T304887
Depends-On: I3105a5fd4826f8667b5232834defc5ec93be32a1
Depends-On: Ie9610a6e83731468311edb3ed17f80fc509de385
Change-Id: I701f12ab94478c3b8e7fd82110ade74a8e6b04ef
|
|
|
|
|
|
|
| |
Conventionally, public constants are accessed via their declaring
class, except for self:: which is an acceptable shortcut.
Change-Id: If05eab72140267e6ef54736710d751d7f24a7860
|
|
|
|
|
|
|
|
|
|
|
| |
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
|
|
|
|
|
|
|
|
|
|
|
| |
Application logic should use the BaseDirectory config variable.
Framework code should use MW_INSTALL_PATH to locate files should.
NOTE: Update https://www.mediawiki.org/wiki/Manual:$IP
Bug: T300301
Depends-On: I7142af16d692f26e90673b058029f572c1ea3991
Change-Id: Ib4caa80bb7007c4c7960a2fd370cf5da7d9ba344
|
|
|
|
| |
Change-Id: I30f2e21eb5d10a54fa5955586be14d9c3eddf056
|
|
|
|
| |
Change-Id: I63399b1ee2f2c8d6f7f6a5781a5a61de5d21ede8
|
|
|
|
|
|
|
| |
Due to a bug in phan the usage needs suppression
Bug: T240141
Change-Id: Ic2da20b663ff2ff291c73329ac1f152d61d1df56
|
|
|
|
|
|
|
|
|
|
| |
This helps phan to detect unreachable code and also impossible types
after the functions.
It helps phan to avoid false positives for array keys
when the keys are checked before
Bug: T240141
Change-Id: I895f70e82b3053a46cd44135b15437e6f82a07b2
|
|
|
|
|
|
|
| |
This reverts commit 0d75fdb4f73ddbf4ad5f29e14258d58e507d55b4.
Bug: T287542
Change-Id: Iedd3461869f973f8d621a39e6ad4674cbb577551
|
|
|
|
| |
Change-Id: I079d2c802d9b48d6abf7f37fa9ef7dafac631345
|
|
|
|
|
|
|
| |
Remove the @internal getter for the global and
use MediaWikiServices directly at one remaining place.
Change-Id: I120f9c00d22d6dcf2a996eec5b9d5e5d41b68284
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Expose info about user blocks from Authority. This allows calling code
to provide more detailed information to the user about why they are
denied some action on the wiki.
Bug: T271494
Change-Id: Ia84e469888866d72752aad355292666c31e12bad
|
|/
|
|
| |
Change-Id: Idfb429549f0281e2edbc532efc347e83e77ab80c
|
|
|
|
|
|
|
| |
This is just a start.
Bug: T254646
Change-Id: I9213aad4660e27afe7ff9e5d2e730cbf03911068
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* ::explodeMultiValue
* ::parseMultiValue
* ::validateLimit
* ::validateTimestamp
Change-Id: I326abedc01d7096e67e193c7967b107e253b8916
|
|/
|
|
|
|
| |
Add private helper ApiBase::dieIfMain()
Change-Id: I3d9881356bd66447e67ccccf20697f4b88885854
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replaces calls directly to PermissionManager with calls to
the Authority object available from Context or the
GroupPermissionLookup service.
This patch does not address use of PermissionManager for
blocks.
Deprecations:
- ApiBase::checkUserRightsAny deprecated passing optional
User parameter
- ApiBase::checkTitleUserPermissions deprecated passing
LinkTarget as first parameter, takes PageIdentity instead
Bug: T271462
Bug: T271854
Change-Id: I5d7cac1c28a37e074750c46cda03283980a07fca
|
|
|
|
|
|
|
|
|
| |
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.
Created by I25a17fb22b6b669e817317a0f45051ae9c608208
Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The mandatory Unicode NFC normalization on API parameters was causing
spurious dirty diffs in VisualEditor/DiscussionTools when editors used
HTML entities to encode non-NFC codepoints, like  . Although
wikitext is (ought to be!) in NFC form, the output HTML may not be,
due to explicit entities in the wikitext.
This type is used in VisualEditor change
I0d34c9a01f1132c2616ed3392ea40d8b73e15325 to prevent Parsoid HTML from
being corrupted when it is round-tripped.
Bug: T266140
Change-Id: I2e78e660ba1867744e34eda7d00ea527ec016b71
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
PHPStorm can use custom folding regions defined in either the
VisualStudio style or the NetBeans style. The VisualStudio style is more
pleasing to the eye and also works as a vim foldmarker. So get rid of
the previous vim foldmarkers, and use region/endregion.
region/endregion need to be in a single-line comment which is not a doc
comment, and the rest of the comment is used as a region heading (by
both PHPStorm and vim). So to retain Doxygen @name tags, it is
necessary to repeat the section heading, once in a @name and once in a
region. Establish a standard style for this, with a divider and three
spaces before the heading, to better set off the heading name in plain
text.
Besides being the previous vim foldmarker, @{ is also a Doxygen
grouping command. However, almost all prior usages of @{ ... @} in this
sense were broken for one reason or another. It's necessary for the @{
to be in a doc comment, and DISTRIBUTE_GROUP_DOC doesn't work if any of
the individual members in the group are separately documented.
@name alone is sufficient to create a Doxygen section when the sections
are adjacent, but if there is ungrouped content after the section, it
is necessary to use @{ ... @} to avoid having the Doxygen group run on.
So I retained, fixed or added @{ ... @} in certain cases.
I wasn't able to test the changes to the trait documentation in Doxygen
since trait syntax is not recognised and the output is badly broken.
Change-Id: I7d819fdb376c861f40bfc01aed74cd3706141b20
|
| |
| |
| |
| |
| | |
Bug: T270450
Change-Id: I90ff94a553ebae9a4ef97c25c333f067f19c327d
|
|/
|
|
|
|
|
|
| |
No longer unstubs $wgUser, because the fallback in ::getUser
is creating a user from the current session
Bug: T243708
Change-Id: I06d78b3c9ec81c558b56550a934af2db045685d9
|
|
|
|
| |
Change-Id: I343d2bae626a3903eb1e67c05bf5caef4314b7dd
|
|
|
|
| |
Change-Id: I78338d48530f098fa5d36fe84cfd45c0d160f444
|
|\ |
|