| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Found via disabling phan's alias support for a run (and ignoring wgLang's
hard-coded state of being a \Language, alas).
Change-Id: I4753bcd84d72d6de111fc7ffc5841fa417bf7333
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- When introducing saveDummyRevision() in I1f8c0ac68b, we didn't account
for the fact that most (but not all) dummy revisions should be marked
as minor edits.
What:
- Add a $flag parameter to saveDummyRevision()
Bug: T198297
Bug: T387067
Change-Id: I1db3ccc816cdb0e2a93593625306a9080b7204eb
|
|
|
|
| |
Change-Id: Iff96024f9b261fff2af4205ee7ac568ce53f84a1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- Improve consistency, naming, documentation and definition of flags.
What:
- remove direct access to flags, provide a separate getter for each flag
instead.
- Deprecate EDIT_SUPPRESS_RC in favor of EDIT_SILENT
- Introduce EDIT_IMPLICIT to replace "automated" mode
- Introduce FLAG_RECONCILIATION_REQUEST into PageEvent.
- Introduce isReconciliationRequest into DomainEvent.
Bug: T383552
Change-Id: I2bffbb5810376829f871e1840ca799a8d8232dda
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Creating dummy revisions was a fiddly multi-stage process.
PageUpdater should just offer a method for doing it.
Change how we create dummy revisions in:
* LocalFile
* MovePage
* ImportReporter
Bug: T198297
Bug: T384691
Change-Id: I4c7595ce24337ab637a4e0fdbb313fc77d452a15
|
|
|
|
|
|
|
|
|
| |
Use modern php syntax to call a callable.
Reduce the stack trace to improve performance
and better IDE and static analyzer
Also replace func_get_args with variables
Change-Id: Ie193c4e996ab136e08f1e16c988448d054520aa7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* Some contributions special pages and APIs accept an IP range
target, with a configured limit, RangeContributionsCIDRLimit.
* ContribsPager::isQueryableRange is a static utility method
for checking an IP range against the limit. This is an
awkward place to have the utility, which is needed in other
places, e.g. ContributionsSpecialPage.
* Now that contributions pages in the CheckUser extension also
need to use it, it is a good time to move it to an
includable trait.
What:
* Introduce ContributionsRangeTrait, with methods for checking
the validity of an IP (range) target against the configured
limit.
* Use the trait in ContribsPager and ContributionsSpecialPage,
and remove the static method ContribsPager::isQueryableRange,
which was marked internal.
* Don't yet use it in APIs, to contain the scope of this
commit.
Bug: T378111
Change-Id: I77cf1873f681b426523f62f2806ecde35fc5cc45
|
|
|
|
|
|
|
|
|
| |
- Replaced class properties with typed properties.
- Updated `$template` to `string`.
- Updated `$text` to `string`.
- Removed redundant type comments.
Change-Id: I53ff765949b8df978b189bd63306ed380a75c912
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* When code throws a UserNotLoggedIn error for a temporary account,
this takes them to Special:UserLogin and asks them to log in to
an account
* Users using temporary accounts are less likely to have a named
account, so should instead be sent to Special:CreateAccount
(as described in T358586)
* When doing this, the warning message should be customised to
talk about the user needing to create an account (and not
log in)
What:
* Update UserNotLoggedIn to redirect to Special:CreateAccount
when the user is logged in to a temporary account
** The code which constructs the exception object can override
this and force the redirect to always be to Special:UserLogin.
* When the redirect is to Special:CreateAccount, allow customising
the message shown by adding a '-for-temp-user' suffix to the
message key in UserNotLoggedIn.
** This suffix is only added if the resulting message exists,
so that code can choose whether they need a message that is
different to the one on Special:UserLogin.
* Update SpecialPage::requiredNamedUser to allow special pages to
force the redirect to always be to Special:UserLogin
** This is made use of in Special:ChangeEmail and
Special:ConfirmEmail, as these special pages only make sense
for use with an existing account.
* Update and add message keys to allow a different message for
Special:CreateAccount.
* Update and add tests for these changes.
Bug: T358586
Change-Id: Ie0dd06f51b1e2b85eef6be377f673a02732ce604
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* The 'resetpass-no-info' message key was added in
bceb3c7d1acbc7f0ad78cbd84f3ae3caca571bd8 but was no longer used
after 854a462dc0aef59e1c26c057792b8a9214449af5.
* Removing this message will reduce the need for unnecessary
translations.
** This will also help reduce the extra message keys needed as a
result of T358586
What:
* Remove the 'resetpass-no-info' message as unused.
Bug: T358586
Change-Id: Ia3148c213732a03d04c13cae1203feb6d3ce30de
|
|
|
|
|
|
|
|
|
|
| |
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: I41ad89cc3112a2911ad40c55583bff2d7787da68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Change AuthManagerSpecialPage::getPreservedParams() to support
a 'reset' mode (where the in-progress authentication stage is
not preserved) and a normal mode (where it is).
* Move handling of language parameters and returnto parameters
from child classes to AuthManagerSpecialPage. These make sense
for any authentication-related special page.
* Handle returntoanchor (previously only supported in the API,
seems useful in general), and validate it better. This will
only work in simple login scenarios as it is not included
in the PostLoginRedirect hook (changing hook interfaces is
hard).
* Merge getReturnToQueryStringFragment() and two instances of
manual query handling into getPreservedParams(), making
query parameter preserving more predictable and paving the
way for a hook mechanism (I86e629b0).
* Fix some parameter handling edge cases around falsy strings.
* Remove LoginSignupSpecialPage::showReturnToPage(), not used
anywhere.
* Remove $mLanguage and $mVariant from the same class, all their
uses got replaced by getPreservedParams().
* Filter out null values from getPreservedParams(). The methods
it's used with will ignore them anyway but might make a
difference in the array_diff_key calls.
Bug: T366476
Change-Id: I7d9eb6b6838c5633135390f1282059a904877faa
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces a new namespace declaration,
MediaWiki\Xml and adds Xml and XmlSelect to it
and establishes class aliases marked as deprecated
since version 1.43.
Bug: T353458
Change-Id: I45cccd540b6e15f267d3ab588a064fbeb719d921
|
|
|
|
|
| |
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update cases where one of the IConnectionProvider methods is called
immediately.
This doesn't really change anything, but I hope it helps promote
getConnectionProvider() as the common way to do this.
Follow-up to 8604c384f624273f46b653ec252ffaed30e6ff89.
Change-Id: Id0e7d02bab0c570343c2b1f03c70b44ee39db112
|
|
|
|
| |
Change-Id: Ife194ba4f077e63f86a95bd0d6ff782098c05040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function is uber-deprecated, meaning even its replacement is
deprecated, We have already migrated in static functions and more.
In this batch, all calls have been migrated that there is already a call
to MediaWikiServices::getInstance() making the migration easier. Of
course in most cases, they should eventually turn into proper service
injection but this at least makes it clear what services should be
injected.
Also removing "category" group since we are removing all groups except a
handful from mw (see T263127 for more information).
Bug: T330641
Change-Id: I90cd35ee45a37eb6e6bf7a531cc8f75effbd0328
|
|
|
|
|
| |
Bug: T347227
Change-Id: Ice9a6f9cfbf6b6640d01e05b02c557f63b6a5600
|
|
|
|
|
| |
Bug: T166010
Change-Id: Ia2e5a7367cc8cdbd8a7b845ae2fd5d776ff22891
|
|
|
|
|
|
|
|
|
|
| |
This class is used heavily basically everywhere, moving it to Utils
wouldn't make much sense. Also with this change, we can move
StatusValue to MediaWiki\Status as well.
Bug: T321882
Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3
Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
|
|
|
|
|
|
|
|
|
| |
The Hooks class contains deprecated functions and the whole class is
going to get removed, so remove the convenience function and inline the
code.
Bug: T335536
Change-Id: I8ef3468a64a0199996f26ef293543fcacdf2797f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I1daa27819c1d50cff4b0abf04ccfaf5ed5103b7e
|
|
|
|
|
| |
Bug: T321882
Change-Id: I5dc1f7e9c303cd3f5b9dd7010d6bb470d8400a18
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Introduced in PHP 7.1. Because it's shorter and looks nice.
I used regex replacement.
Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
|
|
|
|
| |
Change-Id: Ic51713d0b72aab50ce5231c2db7e4bd08eb40d18
|
|
|
|
|
| |
Bug: T313220
Change-Id: I7e35a949b5eebf41608fa40cbc5502b17f13880c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a hook "TempUserCreatedRedirect" which allows an extension to modify
the post-save redirect after a temporary user is created. CentralAuth
will handle this hook in order to redirect to loginwiki. Loginwiki will
redirect back to the page being saved.
In LoginHelper::showReturnToPage add an "anchor" parameter to specify
the URL fragment to redirect to. This is intended for section editing
with a redirect via loginwiki.
In AuthManager::autoCreateUser(), just allow any valid username, don't
require it to be creatable. Previously a non-creatable username was
allowed only with $source=AUTOCREATE_SOURCE_TEMP, but CentralAuth
depends on user autocreation from the session during refreshCookies. The
session is already validated at this point, so it's not like a user can
exploit this to create arbitrary names.
Change-Id: I623330dbf5d0573c93ae22f962618d6ddbd126d9
|
|
|
|
|
|
|
| |
This covers all occurrences of /onfig->.*get( '/ in includes/.
Undoubtedly there are still plenty more to go.
Change-Id: I33196c4153437778496f40436bcde399638ac361
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
- ManualLogEntry::setTarget accepts PageReference
- LinkRenderer::makeLink accepts PageReference
- PermissionManager::isBlockedFrom accepts PageReference
Change-Id: I41901e10c3df22145e92d12de74f0382976bb598
|
|
|
|
|
|
|
|
|
| |
When the value is a constant, the initialization can be done
way up together with the property declaration. I believe
this makes the code easier to read because it's not spread
out so much.
Change-Id: I5af482feccb746c144c0f318e119165cf5a56cbe
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: T278459
Change-Id: I9ff5f1989e15a1fe3988845abae935e6372d40ac
|
|/
|
|
|
|
|
|
| |
In all these cases the property is unconditionally set in
the constructor. The extra initialisation is effectively
dead code and an extra source of errors and confusion.
Change-Id: Icae13390d5ca5c14e2754f3be4eb956dd7f54ac4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All hooks were previously hard deprecated
in 1.35. Affected hooks:
* ArticleRevisionUndeleted - use RevisionUndeleted
* ArticleRollbackComplete - use RollbackComplete
* DiffRevisionTools - use DiffTools
* DiffViewHeader - use DifferenceEngineViewHeader
* HistoryRevisionTools - use HistoryTools
* NewRevisionFromEditComplete - use RevisionFromEditComplete
* PageContentInsertComplete - use PageSaveComplete
* PageContentSaveComplete - use PageSaveComplete
* ParserFetchTemplate - use BeforeParserFetchTemplateRevisionRecord
* RevisionInsertComplete - use RevisionRecordInserted
* TitleMoveComplete - use PageMoveComplete
* TitleMoveCompleting - use PageMoveCompleting
* UndeleteShowRevision - no replacement
Includes a fix for setting the associated rev id
of page protections, which previously was only done
using $nullRevision which was a Revision object created
if any hooks needed it; those hooks were hard deprecated
and so for WMF prod the rev id was not being set.
Bug: T247143
Depends-On: Idfa345193ae99fb2f1c9a8f8d28d8d540a6e3d62
Change-Id: I519167f76a5a3c1f5410415b2721462a3dcc3ec8
|
|
|
|
|
|
| |
Just an auto-replace from codesniffer for now.
Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
|
|
|
|
| |
Change-Id: I0ce2a8154af82a363fef126033b5819c4ee84842
|
|
|
|
| |
Change-Id: I58c5d1bc7bfca872fe0bcfdc51828dcef5abdf02
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Once the Revision class is hard deprecated, we will still need to
run hooks that use Revision objects; even though the hooks will be
deprecated, Revision objects still need to be created for them.
To ensure that deprecation warnings aren't triggered by creating
Revision objects in deployed code, for deprecated hooks only
create the Revision object if the hook is registered.
All hooks that pass Revision objects have already been hard deprecated.
Bug: T246284
Change-Id: I7e718551822825cd390662bb201dd13e2e527e8b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add $wgForceHTTPS. When set to true:
* It makes the HTTP to HTTPS redirect unconditional and suppresses the
forceHTTPS cookie.
* It makes session cookies be secure.
* In the Action API, it triggers the existing deprecation warning and
avoids more expensive user/session checks.
* In login and signup, it suppresses the old hidden form fields for
protocol switching.
* It hides the prefershttps user preference.
Other changes:
* Factor out the HTTPS redirect in MediaWiki::main() into
maybeDoHttpsRedirect() and shouldDoHttpRedirect(). Improve
documentation.
* User::requiresHTTPS() reflects $wgForceHTTPS whereas the Session
concept of "force HTTPS" does not. The documentation of
User::requiresHTTPS() says that it includes configuration, and
retaining this definition was beneficial for some callers. Whereas
Session::shouldForceHTTPS() was used fairly narrowly as the value
of the forceHTTPS cookie, and injecting configuration into it is not
so easy or beneficial, so I left it as it was, except for clarifying
the documentation.
* Deprecate the following hooks: BeforeHttpsRedirect, UserRequiresHTTPS,
CanIPUseHTTPS. No known extension uses them, and they're not compatible
with the long-term goal of ending support for mixed-protocol wikis.
BeforeHttpsRedirect was documented as unstable from its inception.
CanIPUseHTTPS was a WMF config hack now superseded by GFOC's SNI
sniffing.
* For tests which failed with $wgForceHTTPS=true, I mostly split the
tests, testing each configuration value separately.
* Add ArrayUtils::cartesianProduct() as a helper for generating
combinations of boolean options in the session tests.
Bug: T256095
Change-Id: Iefb5ba55af35350dfc7c050f9fb8f4e8a79751cb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
|
|
|
|
| |
Change-Id: Ica6397199603f2979b8c863a1f250da2edd77ba5
|
|
|
|
| |
Change-Id: I9c19e5ce8d789847d0f019372738a2eecb4c37a6
|
|
|
|
|
| |
Bug: T250338
Change-Id: I4ef249d013d1a9bc33d1d0f380c41963635012ab
|
|
|
|
|
|
|
|
|
|
|
|
| |
See codesearch - only deployed call outside of core is in flaggedrevs,
and already passes a RevisionRecord:
https://codesearch.wmflabs.org/deployed/?q=-%3EupdateRevisionOn%5C(&i=nope&files=&repos=
Also fixed a use of Revision::newFromId in orphans.php
Bug: T249561
Bug: T249021
Change-Id: I5933a278de8645b7005c11026c87ae27c0373770
|
|
|
|
|
| |
Bug: T249979
Change-Id: I84bb08032278248bbcc4d620a28f45504ab85d35
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interface generator script now flags any differences between the
argument list at the call site and the documented arguments. Resolve all
such differences.
* In AlternateEditPreview, $parserOutput is a reference, and a
WMF-deployed extension replaces it.
* In DeleteUnknownPreferences, fix missing "$" in &$where
* In LocalisationCacheRecache, document the unused parameter, as is the
convention elsewhere in the file.
* In NewRevisionFromEditComplete, make all callers pass a $tags
variable, and document the fact that there are multiple callers.
* In PageContentInsertComplete, document legacy references
* In PageContentSave, document the fact that $flags and $status are
references. I made them legacy references, since although replacement
will have an effect, no extension relies on this and it is not
documented on the Manual:Hooks page.
* In PageContentSaveComplete, document $wikiPage, $user, $flags and
$status as legacy references. Replacement of $status was broken
by If610c68f4912e89 (MW 1.32), but I confirmed that no extensions
in CodeSearch are currently affected.
* In ParserGetVariableValueSwitch, document $frame as a legacy reference
* In WatchArticleComplete and UnwatchArticleComplete, SpecialEditWatchlist
was passing $user by value where as the other callers were passing it
by reference. Passed by reference. It was already marked legacy.
Bug: T240307
Change-Id: I33f69ebdb5242982fd7986d9877959d2d33149b9
|