Commit graph

19 commits

Author SHA1 Message Date
Thiemo Kreuz a1464bd617 Simplify some API PHP code where possible
Change-Id: I663d9f2a25c70d8d265a3217cd1d0ad6fbb1bb3e
2021-08-26 11:37:13 +02:00
libraryupgrader 30b68f3a74 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0

npm:
* postcss: 7.0.35 → 7.0.36
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)
* glob-parent: 5.1.1 → 5.1.2
  * https://npmjs.com/advisories/1751 (CVE-2020-28469)
* trim-newlines: 1.0.0 → 3.0.1
  * https://npmjs.com/advisories/1753 (CVE-2021-33623)

Change-Id: Ia15aa76cb4abbfe42215532edf52b08c75f72034
2021-07-21 19:56:36 +00:00
Thiemo Kreuz ad014c834d Fix a series of minor style issues in PHP code
* Mismatching capitalization.
* Unused pieces of code.
* Properties that can be constants.
* Use $this->getConfig() in special pages.

Change-Id: Ia7e2c438c5ddd3c770070701e4cbdfc79fccf009
2021-06-03 15:55:38 +02:00
C. Scott Ananian fce9192e82 Rename magic header to be consistent with WMF CDN infrastructure
This name is consistent with T91820.

Bug: T91820
Bug: T259685
Depends-On: I0c4ec63bb26641b237c92dbd3bc5367811ca0675
Followup-to: 3561167493
Change-Id: I4c4c5f83ad56a198d08095d629a6ba86ce9dc1a4
2021-02-04 12:54:21 -05:00
C. Scott Ananian 3561167493 Fix sqlite compatibility by opting out of obligatory write lock
Bug: T259685
Depends-On: If37dc890a24a45c3a914e310b5b5bf625965e9e6
Change-Id: Ib203145f4c9ddfdc6701a916cbbbe17dae85efb9
2021-02-02 18:05:21 -05:00
Thiemo Kreuz e13781ce1f Remove non-helpful lines of documentation
These do nothing but repeating literally what the code already
says.

Change-Id: I93c4a60f190e17a845e37e48b1c0a80bde2292c0
2020-10-07 15:24:50 +02:00
C. Scott Ananian bf79850262 Better warning messages if $oldid or $etag is funny
Change-Id: I65f02ded600662fd19de36ef3a9ae55ecf249226
2020-08-26 18:56:22 -04:00
Kunal Mehta 45a02ee03e Support private wikis in Parsoid zero configuration mode
Set the 'forwardCookies' flag if the wiki is private (not everyone is
allowed 'read' access).

Bug: T260201
Change-Id: I0b958e8b75c04e4a27f50f91276be221a5b1404d
2020-08-11 16:40:44 -07:00
Ed Sanders eb98439453 Move parseWikitextFragment up to ApiParsoidTrait
Rename to 'transformWikitext' and rename 'postHTML' to match.

Change-Id: Icb1f519c7a3a88f36c51479333be8cfb5617dbe0
2020-07-22 14:44:11 +01:00
Ed Sanders 90bf7e0488 Refactor postHTML in ApiParsoidTrait
* Remove postHTML/postData separation, not very useful.
* Pass $oldid instead of full params object.
* Return full repsonse like other methods, instead of just body.

Change-Id: I0fe301475adeb0fd5952809c3f74f0cb19f89cfe
2020-07-22 14:44:11 +01:00
C. Scott Ananian 4b04f413fa Zero-configuration VisualEditor + PHP for MediaWiki LTS
This copies the Parsoid extension code into includes/VEParsoid
to allow a "one extension, zero-configuration" install of
VisualEditor for MW's LTS release. The Parsoid code has been
re-namespaced (`VEParsoid` instead of `MWParsoid`) to avoid
autoloader conflicts if you actually install Parsoid as an
extension (as we do in Wikimedia production). Similarly, we
arrange that the ServiceWiring and RestRoutes configurations
are skipped unless running in zeroconf mode, to avoid
conflicts with the Parsoid extension.

This import matches Parsoid commit b30f223.

Bug: T248343
Change-Id: Ic63ce40f59c4be8f4fdc5f9ac17798353fc86866
2020-07-13 18:39:08 +00:00
Ed Sanders 3dab0f8339 Follow-up I238632e: Allow etag to be null
Change-Id: I45fec02c3d3560ac10d179e59e75cb5f8210ba14
2020-06-26 17:03:31 +01:00
Ed Sanders afc22db25d ApiParsoidTrait: Add typehints
Suggests redundant checks that can be removed.

Change-Id: I238632e0a9af568f7c7a9897c43e4143dc9ebce8
2020-06-26 14:45:16 +02:00
Ed Sanders 703fbaa6a2 Factor out revision fetching and validation logic to ApiParsoidTrait
Change-Id: I7707b419afac2c11d7d0ca91a597ffc68e5e3fe4
2020-06-26 14:44:47 +02:00
jenkins-bot c65b311ecb Merge "Tweaks in API code per code review" 2020-06-03 10:40:14 +00:00
Tim Starling 92ab300859 Use HttpRequestFactory::createMultiClient()
This allows it to respect the proposed limit on HTTP request timeout.

Bug: T245170
Depends-On: I8252f6c854b98059f4916d5460ea71cf4b580149
Change-Id: I1c3d96720709253ad15bb8528cdd132571de2e4e
2020-05-21 14:56:22 +10:00
Bartosz Dziewoński 63638e380d Tweaks in API code per code review
Follow-up to If5c8d95560cbb078ae4980f4a912cbaeafe53d3e.

Change-Id: Iff72b5b21c0f5ce6a45cc48d6a8fc060159d7d23
2020-05-19 19:56:56 +02:00
James D. Forrester 969b1f266b Replace use of old global with MW_VERSION constant
This repo already requires MW 1.35+ so compatibility isn't a concern.

Change-Id: I3be0e1afe7f9acb56e7070d9d81424b7461a1603
2020-05-15 12:09:26 -07:00
Bartosz Dziewoński 0528f806fa Extract Parsoid/RESTBase stuff out of our API code
Goals:
* Allow other extensions to reuse these methods (maybe upstream them
  to MediaWiki core later)
* Allow ApiVisualEditorEdit to extend ApiEditPage. We'll be able to
  reuse its definitions for API parameters instead of duplicating
  them, and we won't have to pass around unrecognized parameters.

Bug: T252573
Change-Id: If5c8d95560cbb078ae4980f4a912cbaeafe53d3e
2020-05-12 21:17:29 +02:00