| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace EditRightConstraint, UserBlockConstraint, and most of
UserRateLimitConstraint with the new AuthorizationConstraint.
Instead of many separate checks, everything is now handled by
one authorizeWrite() call.
Move 'editcontentmodel' rate limit to ContentModelChangeConstraint
(by making it use authorizeWrite()). Keep 'linkpurge' rate limit
in a separate check, renamed from UserRateLimitConstraint to
LinkPurgeRateLimitConstraint, since the way it works in unusual
and not portable to Authority without more refactoring in EditPage.
AuthorizationConstraint needs some special handling to produce
the idiosyncratic result codes required by EditPage, but luckily
PermissionStatus gives us everything we need for that.
Bug: T271975
Bug: T386346
Change-Id: Ic9f6f2fbd29efa3e349517013da540a363c263b5
|
|
|
|
|
| |
Bug: T353458
Change-Id: I3e829e35c93bcaae75e401b1801bddf93c0b416c
|
|
|
|
|
|
|
|
|
| |
In MediaWiki/Exception, to follow PSR-4 per plural vs. singular (this can be
changed later if people really care). Also, move the couple of exceptions in
here that were already namespaced in the MW-top-level into the new space.
Bug: T353458
Change-Id: I12ed850ae99effb699a6d7ada173f54e72f0570e
|
|
|
|
|
| |
Bug: T353458
Change-Id: I2ae4577de79832b082adca282ff73cfabc8f9392
|
|
|
|
|
| |
Bug: T353458
Change-Id: Ibe1810f1c71316a9124e1dc6ae405097dafd5267
|
|
|
|
|
| |
Bug: T353458
Change-Id: Id3ca24e22877e544b707a8a527a58e00cc1bc247
|
|
|
|
|
| |
Bug: T353458
Change-Id: I7a9c74f2106655d41ae029742090253f541bd4a6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- Rollback and undo should not use the "edit" cause, since they are
triggered by a dedicated user action.
What:
- Introduce constants for rollback and undo into PageUpdateCauses.
- Set update cause in McrUndoAction, EditPage, WikiPage, and
Rollbackpage.
- Add test cases asserting the properties of the PageUpdatedEvent for
manual reverts, undos, and rollbacks.
Bug: T378936
Change-Id: If3174732846795e322ddd61257459395eb10e73e
|
|
|
|
|
|
|
|
|
| |
This reverts commit 1695950bccb1ca7eba98952753708ae7c4b76d8d and re-applies commit I8f3c2ea021d0f6e.
Reason for revert: the remaining usages have been updated in Ida665f486eff384.
Bug: T166010
Change-Id: I43f06e6872b264e43aef7fa7c2ac47159926a694
|
|
|
|
|
|
|
|
|
| |
This reverts commit db47e7f7154a2121bce6d3d9e93a74486bf765f3.
Reason for revert: Broke scap sync-world in beta, and possibly caused T387938
Bug: T166010
Change-Id: If608c3e27081bb36b284ad16a5b912dd51b3557e
|
|
|
|
|
|
|
| |
Bug: T166010
Depends-On: Iba93dd9749656e641c427e01790d7a14cd1a2dc2
Depends-On: I97ccc2c49ce09ca96192bf6ffdc833c1765c3faa
Change-Id: I8f3c2ea021d0f6e574dde901f0bfd4a0408f5455
|
|
|
|
|
|
|
|
|
| |
Generate the error message in the getLegacyStatus function in the constraint
class instead of EditPage. The submit button label has to be passed to the edit
constraint since the logic for determining it it resides in EditPage.
Bug: T384399
Change-Id: Id2a9ab57198dfa4df07f91b067944e9f9fefb81a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of special-casing it in EditPage and in ApiEditPage,
PageSizeConstraint sets the error message itself.
Add some notes about T384399. I hope this change can serve as an
example for further work on that task.
Other changes:
* Do not show the error on editor load, only on edit form submission.
The error on load was added in 2006 when the maximum page size was
first limited (aa2bde93 / SVN r13070), and should not be needed any
more now that there shouldn't be any pages exceeding the limit in
the database any more. In case there are, the user will still get
the message when they try to save an edit.
* Streamline the message (there's no need for emphasis in the message,
since it's shown in a very prominent error box these days).
* Use the same message in API errors. Preserve the API error code for
compatibility.
* Alphabetically sort some arrays and switch cases.
Bug: T384399
Change-Id: I0892d1189e29013b9ff4325c8017bab524b84b7e
|
|
|
|
|
|
|
| |
Add preservation of client-side tags when using preview/show changes functionality, ensuring they are included in the final saved edit.
Bug: T385260
Change-Id: Ia9680bd3ba4d790ecf89ebb5497f896c0b2cb893
|
|
|
|
|
|
|
|
| |
Shows a warning when trying to create a redirect that points to another
redirect.
Bug: T326056
Change-Id: Ieb51dde88ce6c23753f74191a85cd40f0bfbd864
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Same as Ia294bf4 did for 1-line comments. This patch removes slightly
more complex 2-line PHPDoc comments that don't add any new information
to the code, but literally repeat what the code already says.
They say "don't document the code, code the documentation", and we
are doing this more and more. We just tend to forget to remove the
obsolete comments.
Note I'm also removing a line of text in a few cases when it's very
short and literally says the same as the method name. Again, such
comments add zero new information.
Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I assume these are all either auto-generated by an IDE or the
language-level type declarations have been added later. In any case
the comments don't add any new information to what the code already
says. This is just extra clutter that makes the code harder to read,
I would argue.
There are many, many more comments like this. In this patch I
intentionally focus on the most trivial 1-line comments.
Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
|
|
|
|
|
|
|
|
| |
If the value is compared against a static ASCII string.
The UTF-8 normalization of getVal is not needed here.
Change-Id: Id85f1218a9d76b9ca69fb833348e531387089711
|
|
|
|
|
|
|
|
|
| |
isset() should only be used to suppress errors, not for null check.
When the property is always defined, there is no need to use isset.
Found by a new phan plugin (2efea9f989)
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset
Change-Id: I186e799256fbaf5ee77558bd146f9418dd5eaacc
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As far as I can tell, no one ever used the "$key-value-text" or
"$key-value-html" keys, only "$key-value":
https://codesearch.wmcloud.org/search/?q=-value-(html|text)%22%3A&files=en.json
https://global-search.toolforge.org/?q=.*®ex=1&namespaces=8&title=.*-value-%28html|text%29
They were added in 2013 (2b20038ce77ce8b939113a3edb7d25127c238d4e).
Change-Id: I175e834e2b425f0ba1b8650ae44dbf65fb23fe6e
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some entries in the limit report are not supposed to appear in this
table, because they require parameters other than the one or two
numeric parameters supported by this code. RenderDebugInfo already has
a list of them and special handling.
However, excluding them relied on this check within the foreach loop:
if ( !$keyMsg->isDisabled() && !$valueMsg->isDisabled() ) ...
which will pass in qqx mode, or if the message key is defined on-wiki.
Instead, exclude them based on a list, like in RenderDebugInfo.
Bug: T379971
Change-Id: Ie0ccb2d7ddab0ac4ba30f27c908059f23fb387a1
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This restores the original intent of ec1714baee (SVN r73875),
lost somewhere during ContentHandler refactoring years ago.
Test plan:
View an empty protected page, a non-empty protected page,
and a non-existent protected page. (Also test with the
namespace protection for the 'MediaWiki:' namespace.)
Bug: T249978
Change-Id: I454a55a3c09a8be2640218d6301aad00c76921c1
|
| |
| |
| |
| |
| |
| |
| | |
Rename the brokenredirect i18n key to edit-constraint-brokenredirect, as
requested in patch 1090544. Follow-up to 1089205.
Change-Id: I544fd9adc38f916f549d3fa1b7da51283a3beb68
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Shows a warning when trying to create a redirect that points to a nonexistent page.
Update api tests to create the targets before the redirects.
Bug: T326057
Change-Id: Ib530f17527aa8e14b8865086faa8d9feff6116ef
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When accessing slot content and meta-data, most code wants to only
access the main slot. Add convenience methods for making this less
awkward.
Originally, the intent was for all code to support arbitrary slots. This
hasn't happened, instead we spread SlotREcord::MAIN all over the code
base. It seems better to adjust the interface of RevisionRecord to
reality.
Change-Id: I8603f95c8e39d6fc3522a47f74657798e7f7c061
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Use pretty error boxes instead of 'error' CSS class.
* Use Status::getMessages() and display each error individually,
instead of getWikiText(). The latter sometimes messes up the display
of complex messages, such as customized AbuseFilter errors.
* Add missing 'mediawiki.codex.messagebox.styles' (some of these pages
already used pretty error boxes in other code paths).
* Other minor fixes.
Bug: T377384
Bug: T375287
Change-Id: If2299f98f23e9ad057bce56260e264507337e0b6
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
Edit page is using the message boxes to style errors or warnings.
As edit page is using many dynamically content like live preview,
just load the style always as some other styles.
Bug: T380944
Change-Id: I43fdd5c0e37dba22c332d649dcd787a799139142
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| | |
This replaces the internal uses of the deprecated ParserOutput::get*
methods and isolates the ParserOutput internal representation from
most of the users.
Change-Id: I32df68714ffdf2f0745b974f47bc3ccceef1f41c
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use WebRequest::getQueryValues() instead of WebRequest::getValues()
whenever the result is used to generate links or redirect URLs,
so that only GET query params are copied and not POST params.
This is the same change as I53e58c16cd1292d78b5775358fc180901f4ce203
(for T309907), but repeated in several more places.
Two of these had bugs filed for it (T152920, T291852), others were
as yet undiscovered.
Some of my changes have no effect in practice (e.g. when the code
is guarded by wasPosted()), but I'm changing them anyway to avoid
perpetuating the bad pattern.
Bug: T152920
Bug: T291852
Change-Id: I67fbf82a7ec084623595e6aff62c26dbcce8fa4d
|
|
|
|
|
|
|
| |
Improving coupling.
Bug: T376565
Change-Id: I109662cc957e1a64396348d7c2f5d2eadedb9722
|
|
|
|
|
|
|
| |
This makes it clearer what kind of connections they refer to and is
consistent with the vast majority of callers.
Change-Id: I2c5499439731b73dad90b78e5ab1069d468fe3d3
|
|
|
|
|
|
|
|
|
|
|
| |
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: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
|
|
|
|
|
| |
Bug: T353458
Change-Id: I23cf7991f8792d4d000d1780463d8ce76dc0aee0
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is the fourth patch of a series of patches to remove
ParserOutput::getText() calls from core. This series of patches should
be functionally equivalent to I2b4bcddb234f10fd8592570cb0496adf3271328e.
Here we replace calls to getText where a ContentRenderer is available
close by by temporary ParserOutput::runOutputPipeline that will
eventually be replaced by a call to (probably) ContentRenderer
(T371004). Doing this work in stages allows us to separate the work of
"bring ParserOptions to the call site" from the work of "bringing
ContentRenderer(ish) to the call site", since both need to be done for
to make ParserOutput a value object (T293512).
Change-Id: Ib4f9357293dc230df6e0ca2379a1e2a4cc1b91b7
Bug: T293512
|
|/
|
|
|
|
|
|
|
|
| |
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: Id75cb2e5fbee0fe7600f92473d876f23730d46b7
|
|
|
|
|
| |
Bug: T353458
Change-Id: Ia0f3e22078550be410c4b87faf6aa4eabe6e270d
|
|
|
|
| |
Change-Id: I30c6da024f9e5e54d47d612568fcdae77693b46b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you start editing a page, and then something prevents you from
saving your edit while you were working on it, and you try to preview
your changes, we usually display an error about it (and let you copy
the wikitext you wrote, but don't allow continuing to edit).
However, if you were prevented from saving by being blocked, this did
not happen – the editor would pretend that everything is okay until
you tried actually saving changes.
There is even a comment elsewhere in this file about it:
but that case did not actually trigger for blocks, only in other
situations, e.g. when a page is protected during the edit.
This special case was originally added in 2005
(ee1fc77f735b32dc39e5436770e0bbe0c0af9fb6 / SVN r7462),
seemingly only to improve performance, but that reason
has been lost in the many refactorings since (the blocks
were checked anyway, the errors were just ignored afterwards).
Change-Id: Ia7d8c26089f5124614d750ad3fe0bcabd8f2e60f
|
|
|
|
|
|
|
| |
Follow-up for 48c8cee1831429ac4c980f3a607e1d2daec35945, caught by the
forthcoming release of MediaWiki-CodeSniffer.
Change-Id: Ib75df401916e8a0d750844ec364c5ab8f92ff003
|
|
|
|
|
|
|
|
|
|
|
| |
As part of refactoring the edit save logic, remove this public entrypoint - the
attemptSave() method is still available. Because the actual logic is still
needed by core, we move it to a new private method,
internalAttemptSavePrivate(), and call that from the deprecated
internalAttemptSave() method.
Bug: T157658
Change-Id: I79ccb85f645e15256c4b5867ef3997d10a611e53
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This code was in a big method and had a single responsibility
so was a good candidate for extracting into its own private
method
- Cut and paste a big block of code
- Move `$disableAnonTalk = $services->getMainConfig()->get( MainConfigNames::DisableAnonTalk );`
into the new method
- Add docblock
- Change #comment to //comment in the new method, for consistency within the new method
- No-op
Change-Id: I379bfa67a4518ca46da482578271471fa43ea4e2
|
|
|
|
|
|
|
|
| |
- rename $def_content to $defaultContent
- rename $popts to $parserOptions
- remove some line breaks
Change-Id: I497c703652b094d5a69d71558037a2cc0b6683fd
|
|
|
|
|
|
|
|
|
| |
Instead of conditionally adding it, move the check for the section being new or
not into the constraint, to reduce the logic needed in
EditPage::internalAttemptSave().
Bug: T157658
Change-Id: If16f5a097dd38c5206f748fa4fb8dc6e56cf09cb
|