Commit graph

18 commits

Author SHA1 Message Date
Kunal Mehta
a85f569dd1 Revert "Use CsrfTokenSet as CSRF token source"
This reverts commit 0d75fdb4f7.

Bug: T287542
Change-Id: Iedd3461869f973f8d621a39e6ad4674cbb577551
2021-08-05 15:48:26 -07:00
libraryupgrader
5357695270 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs now pass and were enabled:
  * Generic.ControlStructures.InlineControlStructure
  * MediaWiki.PHPUnit.AssertCount.NotUsed

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)

Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
2021-07-22 03:36:05 +00:00
Petr Pchelko
0d75fdb4f7 Use CsrfTokenSet as CSRF token source
Change-Id: I079d2c802d9b48d6abf7f37fa9ef7dafac631345
2021-07-12 14:19:15 -07:00
jenkins-bot
6eb8c5a6da Merge "Use IEC prefixes instead of SI prefixes for byte sizes (docs+backend)" 2021-06-29 10:34:41 +00:00
Fomafix
356f1b72ef Use IEC prefixes instead of SI prefixes for byte sizes (docs+backend)
This change doesn't change any UI messages.

Bug: T54687
Change-Id: Ia62899a2a6fe8910618c35cd667291e397ddb055
2021-06-28 11:59:09 +01:00
DannyS712
b45ddb2ab3 Use WikiPage::doUserEditContent() instead of ::doEditContent()
Results in passing a user where previously the fallback
to $wgUser was being used, mostly in tests.

Bug: T255507
Change-Id: Iabe24315b23c0ad1272353186425e71974528d23
2021-06-28 00:11:30 -07:00
James D. Forrester
df5eb22f83 Replace uses of DB_MASTER with DB_PRIMARY
Just an auto-replace from codesniffer for now.

Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
2021-04-29 09:24:31 -07:00
Func
278e195ab7 Set $status->value in EditFilterMergedContentHookConstraint::checkConstraint() properly to display error message
When hook handler return false and use $status->fatal() to put up a error,
we should set $status->value to self::AS_HOOK_ERROR_EXPECTED to show edit form
and display error message.

Bug: T273354
Change-Id: I02d643c5cb1978da8ab749856493d75137b6cb02
2021-04-15 22:01:30 +02:00
Petr Pchelko
595d605e34 Convert EditConstraints to Authority
Bug: T271977
Change-Id: I12a2f71f52a1ba7e94bf325621e62ed0e255601b
2021-03-03 17:12:07 -07:00
Umherirrender
a1de8b8700 Tests: Mark more more closures as static
Result of a new sniff I25a17fb22b6b669e817317a0f45051ae9c608208

Bug: T274036
Change-Id: I695873737167a75f0d94901fa40383a33984ca55
2021-02-09 02:55:57 +00:00
DannyS712
f14c2cb8ef Add AccidentalRecreationConstraint
Bug: T157658
Change-Id: Ia9346ceb06ca060cd6e953b1d5b358aabc853eb3
2020-11-16 22:36:54 +00:00
DannyS712
f10795c3cd EditPage: Add two more constraints
- AutoSummaryMissingSummaryConstraint
- SelfRedirectConstraint

Bug: T157658
Change-Id: I0bc29d81ec3df6228a04f41df66b53b113792e38
2020-11-11 23:15:42 +00:00
DannyS712
3b0c5e579b Move EditPage::runPostMergeFilters to a constraint
Bug: T157658
Change-Id: I071163d6d2538948693527c36e8e59281f528402
2020-11-10 23:34:20 +00:00
DannyS712
d7a737fca9 Rename MissingSummaryConstraint to NewSectionMissingSummaryConstraint
There is another place a missing summary is
checked, with different parameters and under
different conditions

Bug: T157658
Change-Id: I988a34a2a130244e6e250259b66727ef979a91ec
2020-11-09 22:59:20 +00:00
DannyS712
44418378e0 EditPage: Factor out more constraints
CreationPermissionConstraint
DefaultTextConstraint
MissingCommentConstraint
MissingSummaryConstraint

Bug: T157658
Change-Id: I55cf336ff6dfb990045e43e6dcd7437a241a46b2
2020-11-04 21:29:54 +00:00
DannyS712
cc8bab4111 Add PageSizeConstraint and ChangeTagsConstraint
Bug: T157658
Change-Id: I2c7b4f77cd07c72b42eaeb7e37095461c92b367a
2020-10-28 16:03:02 +00:00
DannyS712
f40958384a Clean up EditPageConstraintsTest
Bug: T157658
Change-Id: I5364909e605c86e91c0dea1ca8e4e02ac8219266
2020-10-28 02:50:26 +00:00
DannyS712
05ae763ba2 EditPage: Migrate more checks to constraint
Add
- ContentModelChangeConstraint
- EditRightConstraint
- ImageRedirectConstraint
- ReadOnlyConstraint
- UserBlockConstraint
- UserRateLimitConstraint

Additionally:
- Split EditPageTest into a separate file for
all of the constraints being tested

- Add a helper EditConstraintTestTrait

- Add debug logging for EditConstraintRunner for
the result of each constraint

- Changed the order of some of the checks, which
may result in a different failure code if multiple
checks were going to fail, but shouldn't change the
overall result of whether an edit fails or not.

Bug: T157658
Change-Id: Ib8f8b62b9928544e5559c96d82bf850dd8cf9b05
2020-10-26 22:01:05 +00:00