Commit graph

8 commits

Author SHA1 Message Date
James D. Forrester
a5387c7c20 Namespace all remaining classes in includes/parser
Bug: T353458
Change-Id: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
2024-10-15 23:54:32 +01:00
Kunal Mehta
4d49a4a59e Extract LintErrorChecker out of SignatureValidator
This code was partially copied into MassMessage and will hopefully
enable more places that accept arbitrary wikitext to check lint errors.

It also hides the internal details of checking with the Linter
extension's configuration in one place until it can be refactored into
something more acceptable (T360809).

Bug: T368690
Change-Id: Iaeb3ccbd61a2a8cb0d8b3dc8b06a3a10bc8fa653
2024-07-29 14:35:40 -04:00
C. Scott Ananian
8b922a64b1 SignatureValidator: Don't fail signature validation on hidden lints
Bug: T360809
Bug: T360796
Change-Id: Ia3512b5e7bb6eae6bfa9b9ae67611a9f977e6bb3
2024-03-29 15:55:02 -04:00
Bartosz Dziewoński
ec9247c3e8
SignatureValidator: Call Parsoid directly instead of via REST API
I wrote this code before it was feasible to call Parsoid directly from
MediaWiki code, but now it is, so let's get rid of all this indirection.

This lets us add tests for this without mocking the whole world.

Change-Id: I32fea6d0e309ca6f06b3a249fba6e9a311057ce4
2023-08-09 09:39:23 +01:00
Amir Sarabadani
09b18a8f4c Reorg: Move Title-related classes to title/
These three classes:
 - TitleArray
 - TitleArrayFromResult
 - TitleFactory

We need to move these and the rest of files under title/ to Title/ (and
namespace them) but the patch will become way too big given that Title class is
also one of them.

Bug: T321882
Change-Id: Iac1688172ee457348a08a470c86e047571feb8e0
2022-11-26 09:30:32 +00:00
Tim Starling
f270881ca2 Deprecate Parser::getFreshParser()
Following up on the comment I made at Ibbc1423166f4804a5122, make Parser
instance management a ParserFactory responsibility. It is weird for
Parser to have a ParserFactory proxy aspect.

* Add ParserFactory::getMainInstance(), which is equivalent to the old
  MediaWikiServices::getParser() and $wgParser.
* Add ParserFactory::getInstance(), which is equivalent to
  $wgParser->getFreshInstance(), returning the main instance if it is
  free, or a new instance otherwise. The naming is supposed to encourage
  it as the default way to get a parser, which will help with the linked
  bug.
* Deprecate Parser::getFreshParser() and migrate all core callers.

I left the entry in ServiceWiring.php so that it's not immediately
necessary to migrate ObjectFactory specs that ask for Parser.

Bug: T310948
Change-Id: I762b191e978c2d1bbc9f332c9cfa047888ce2e67
2022-07-05 14:09:36 +10:00
Tim Starling
13c1839735 Fix SignatureValidatorFactory circular dependency
Parser is using the service container to get a SignatureValidator
because, as noted in Gerrit comments on the relevant commit, there is a
circular dependency Parser -> SignatureValidatorFactory -> Parser.

So, have SignatureValidatorFactory::__construct() take a closure which
returns a Parser, instead of an actual Parser or ParserFactory.

Change-Id: I7bf4660f84ec8c8fb1d5b3b8581fe5d82bc3156e
2022-04-13 12:38:00 +10:00
Derick Alangi
11f2064333 preferences: Introduce SignatureValidatorFactory service
Change-Id: Ib8df0e76b81c8f3ad592f1caa3be86ac3597a0cf
2021-12-14 12:10:32 +00:00