Commit graph

1248 commits

Author SHA1 Message Date
jdlrobson
24949480eb Give skins more flexibility over table of contents render
* Do not store table of contents in parser output
* Instead inject table of contents via strpos where needed
  inside Article based on Skin "toc" option
* Use <mw:tocplace> as a TOC placeholder; for Parsoid compatibility
  this will be replaced with a <meta> tag in a followup patch.

Bug: T287767
Change-Id: I44045b3b9e78e7ab793da3f37e3c0dbc91cd7d39
2021-10-25 22:26:41 +00:00
C. Scott Ananian
4834340ec0 Deprecate ParserOutput::addWarning() in favor of ::addWarningMsg()
Encourage localization and factor out common code by taking a message
key as the first argument to ::addWarningMsg() instead of a wikitext
string.  This also plays nicer with Parsoid by separating out the
localization code from the parse.

Bug: T293515
Change-Id: I6a7c04c67ac586ab00d4edcbb3d09485a7794e23
2021-10-15 16:06:13 -04:00
C. Scott Ananian
06ab90f163 Add new ParserOutput::{get,set}OutputFlag() interface
This is a uniform mechanism to access a number of bespoke boolean
flags in ParserOutput.  It allows extensibility in core (by adding new
field names to ParserOutputFlags) without exposing new getter/setter
methods to Parsoid.  It replaces the ParserOutput::{get,set}Flag()
interface which (a) doesn't allow access to certain flags, and (b) is
typically called with a string rather than a constant, and (c) has a
very generic name.  (Note that Parser::setOutputFlag() already called
these "output flags".)

In the future we might unify the representation so that we store
everything in $mFlags and don't have explicit properties in
ParserOutput, but those representation details should be invisible to
the clients of this API.  (We might also use a proper enumeration
for ParserOutputFlags, when PHP supports this.)

There is some overlap with ParserOutput::{get,set}ExtensionData(), but
I've left those methods as-is because (a) they allow for non-boolean
data, unlike the *Flag() methods, and (b) it seems worthwhile to
distingush properties set by extensions from properties used by core.

Code search:
https://codesearch.wmcloud.org/search/?q=%5BOo%5Dut%28put%29%3F%28%5C%28%5C%29%29%3F-%3E%28g%7Cs%29etFlag%5C%28&i=nope&files=&excludeFiles=&repos=

Bug: T292868
Change-Id: I39bc58d207836df6f328c54be9e3330719cebbeb
2021-10-15 14:25:54 -04:00
C. Scott Ananian
9632dfb041 Move ::addTrackingCategory() implementation to TrackingCategories
This moves the implementation of ParserOutput::addTrackingCategory()
to the TrackingCategories class as a non-static method. This makes
invocation from ParserOutput awkward, but when invoking as
Parser::addTrackingCategory() all the necessary services are
available.  As a result, we've also soft-deprecated
ParserOutput::addTrackingCategory(); new users should use the
TrackingCategories::addTrackingCategory() method, or else
Parser::addTrackingCategory() if the parser object is available.

The Parser class is already kind of bloated as it is (alas), but there
aren't too many callsites which invoke
ParserOutput::addTrackingCategory() and don't have the corresponding
Parser object handy; see:

https://codesearch.wmcloud.org/search/?q=%5BOo%5Dutput%28%5C%28%5C%29%29%3F-%3EaddTrackingCategory%5C%28&i=nope&files=&excludeFiles=&repos=

Change-Id: I697ce188a912e445a6a748121575548e79aabac6
2021-10-15 14:17:58 -04:00
Fomafix
e86f180bd4 Merge "Encode & to &amp; in displaytitle fallback" 2021-10-14 17:58:06 +00:00
Fomafix
ecc4077ebe Merge "Parser: Explicit check for false instead of falsey" 2021-10-14 17:32:32 +00:00
jenkins-bot
df9a903d49 Merge "Fix regex typo" 2021-10-14 16:49:06 +00:00
Umherirrender
468721ab07 Replace deprecated Language::getConverter in CoreParserFunctions
Bug: T252095
Change-Id: I536543c516bf952967ada17cc781a9d125421b3e
2021-10-14 16:06:24 +00:00
C. Scott Ananian
3056737420 Make Parser::$mStripState private
This property was deprecated in 1.35.  The replacement function
Parser::getStripState() was introduced in MediaWiki 1.34.

Code search:
https://codesearch.wmcloud.org/search/?q=-%3EmStripState&i=nope&files=&excludeFiles=&repos=

Depends-On clauses below are for WMF-deployed code.  Other uses in
non-WMF-deployed code have been patched in:
* https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/4936
* Idc2fadf5105d6eb30777a16dff0035bceff17174 (BlueSpiceSocial)
* I130fd61a8fe2d28e6b116a3fcc767b8abd466cea (ContributionScores)
* I3676fe9882ce9de5732cb7230528134df544ff98 (HierarchyBuilder)
* Ic392afd1e93ae0003fd0ab65114ec1ff38bb2927 (Mpdf)
* I4b01017da752def982777c4fea5fad5e21e4c7ea (MsLinks)
* I09726078ee62eb99e032b8faa5f938e20107f48c (Negref)
* Ibfd6b7064a8e650c3492e0d2764d4f7afc4937bf (PageForms)
* Ia865435688d36178508f21cffae79538c919035c (PageInCat)
* Ib94db0e6d365e4cb3f51121340a04d31b88add62 (ParserFun)
* I8660c0691b7e9842106d7dcb224ff5ecf374e4bc (PhpTags)
* I1ad5f78e5a937767123400ceca4967941e256e5e (RandomImageByCategory)
* I4539e7cea597f71b2a2d9a6cae137bc25085ed6b (ReplaceSet)
* If8ff2e21952b3f08d3a8950d42e2afb56973fb89 (SemanticDrilldown)
* I4a5bd64760cdde5b614a7d4e2b09e8d0634b2056 (SemanticPageSeries)
* Ia04f1aac1d8ae4ea16c98cfbbe72195fffe653b6 (SemanticRating)
* Id2a2e2d024922e3babf756ebae1a4f59b4358146 (Spark)
* I4a979024b18ec4834dc06b51ee0f018d749c6dab (Tooltip)
* Iaf179914863998b32bfecc16c874c3cffd6c26e9 (VIKI)
* I2de0e7a6c133c2e1f3cb7502a81d809c4489db4c (XSL)
* https://gitlab.com/hydrawiki/extensions/characterescapes/-/merge_requests/1 (characterescapes)
* https://github.com/JeroenDeDauw/Validator/pull/38 (Validator)
* https://github.com/lingua-libre/CustomSubtitle/pull/3 (CustomSubtitle)
* https://github.com/mkroetzsch/AutoCreatePage/pull/12 (AutoCreatePage)
* https://gitlab.com/nonsensopedia/extensions/advancedbacklinks/-/merge_requests/95 (advancedbacklinks)
* https://github.com/vonloxley/Shariff-Mediawiki/pull/16 (Shariff-Mediawiki)

Bug: T275160
Depends-On: I062ac8b69756a7ad35d8cc744b4735fd2e70f13e
Depends-On: Ic4be2bad176f2c59a1104219be10045cd5929261
Depends-On: I3cb117a91c8c57331b6b513f64ddb68d6ae2758c
Depends-On: I67b5926f2f851b3dc709d044eec5dd3df5065482
Depends-On: I7806068e1cd6e4da66adfe7bb75095d4bfb5d6bc
Depends-On: I429da35ca4e276c852b8d6ee102ff19f742c22c0
Change-Id: I4af85a46cfcafba15aa5ee50fda9f7b04681d6e6
2021-10-13 19:58:50 -04:00
xiplus
59b2f57b13 Fix regex typo
Fix regex for no-conversion marks.

Change-Id: I1f9216a859bf91324c5943202c303c59f1a88595
2021-10-13 14:39:36 +08:00
C. Scott Ananian
af5d13c5de Rename ParserOutput::{get,set,unset}Property to {get,set,unset}PageProperty
The ::getProperty() naming is too generic and doesn't clearly indicate
that these are "page properties" (which have their own table in the DB).
As part of refactoring a clean API out of ParserOutput which can be used
by Parsoid, clean up the naming here.

Soft-deprecation in this patch, there are a handful of external users
which need to be cleaned up before we hard-deprecate.

Bug: T287216
Change-Id: Ie963eea5aa0f0e984ced7c4dfa0fd65d57313cfa
2021-10-08 10:07:17 -04:00
jenkins-bot
e5b8997536 Merge "Remove "auto-number headings" preference" 2021-10-05 19:18:40 +00:00
Fomafix
eed3121a8f Encode & to &amp; in displaytitle fallback
The value in the attribute displaytitle must contain valid HTML. The
sanitizer of the {{DISPLAYTITLE}} parser ensures that only valid HTML
is accepted.

If there is no {{DISPLAYTITLE}} in the wikitext then displaytitle
falls back to $title->getPrefixedText(). Here an HTML encoding of
special characters is necessary. This affects only the replacement of
& by &amp; because other special characters like < and > are not
allowed in the title.

This change affects the displaytitle fallback on the following places:
* ApiParse
* ApiQueryInfo
* InfoAction
* Parser

The displaytitle fallback in OutputPage is also updated to this
behavior although
Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $html )
also replaces & by &amp;.

Also add test cases with & in the displaytitle to:
* ApiParseTest
* ApiQueryInfoTest
* parserTests

Bug: T291985
Change-Id: I8ee1e2731d9bfa49725d663b34986e7e3073e4ca
2021-10-05 18:09:15 +00:00
Fomafix
3300971232 Parser: Explicit check for false instead of falsey
Because in PHP is "0" == false.

Also
* Combine $this->mOutput->setTitleText calls.
* Avoid inverted logic. Use
    if ( !A && !B && !C && D )
  instead of
    if ( !( A || B || C || !D ) )
* Document false as possible return value.

Change-Id: I92c343b74a9b313b10a2c9b31717a3727aed4cde
2021-10-05 18:02:08 +00:00
Umherirrender
cee3a7643f parser: Add @since to Parser::getUserIdentity
Follow-Up: Idf8578e88af1fd4824f49417a200b16befdbca51
Change-Id: I72ecd10ff3dc861dc96356b39a825f870413f133
2021-10-03 21:37:42 +02:00
Amir Sarabadani
649bbdd6c5 Remove "auto-number headings" preference
Bug: T284921
Change-Id: Ic9ed88f419419cf4cc5cc32010539eea8b76314b
2021-10-03 00:47:08 +02:00
C. Scott Ananian
db81b56adf Rename ParserOutput::hideNewSection() -> ::setHideNewSection()
This name is consist with the rest of the setter and getter methods
in ParserOutput (note that ParserOutput::getHideNewSection() already
exists and is consistently named).

Hard deprecated the old name for 1.38.  Rarely used outside core, and
a pull request already created for the one outside user:
https://github.com/SkizNet/mediawiki-WikiMirror/pull/15

Code search:
https://codesearch.wmcloud.org/search/?q=hideNewSection&i=nope&files=&excludeFiles=&repos=

Bug: T287216
Change-Id: Ia553373eef78f875a83ad0eebfe2e465ce33272f
2021-09-29 17:47:54 -04:00
jenkins-bot
3ab14c18ca Merge "Move Content::getParserOutput & AbstractContent::fillParserOutput to ContentHandler" 2021-09-29 13:10:00 +00:00
Roman Stolar
a68e641f9d Move Content::getParserOutput & AbstractContent::fillParserOutput to ContentHandler
Update/Create override classes of ContentHandler.
Soft-deprecate and remove method from Content and classes that override them.

Bug: T287158
Change-Id: Idfcfbfe1a196cd69a04ca357281d08bb3d097ce2
2021-09-29 13:10:51 +03:00
jenkins-bot
f3cf265e75 Merge "Parser::preprocess and ::preSaveTransform put one parameter per line" 2021-09-28 15:47:04 +00:00
Petr Pchelko
a407ce4124 Remove hard-deprecated methods returning User from Parser
Change-Id: I4ff100136a777974f7206f599422589d51f02b88
2021-09-26 14:50:14 -07:00
Tim Starling
65b1b6b56a Remove $wgShellLocale, always use C
$wgShellLocale was a flawed solution to the problem of locale
dependence. MediaWiki has its own concept of locale (the Language
hierarchy) and any kind of dependence on the server's libc locale is
incorrect and harmful, leading to bugs. Developers have an expectation
that functions like strtolower() will work in a certain way, and
respecting the locale set in the environment at install time violates
this expectation.

The problems with using C as a locale, which led to $wgShellLocale, are:

* escapeshellarg() will strip non-ASCII characters. This can be worked
  around by not using it. The security vulnerability it was trying to
  fix can be prevented in another way.
* Shell commands like rsvg will fail to correctly interpret UTF-8
  arguments. This is the reason for the putenv(). On Linux, this can
  be fixed by using C.UTF-8, which we didn't know at the time. On
  Windows, the problem is not relevant (there are unrelated issues
  with UTF-8 arguments).

Bug: T291234
Change-Id: Ib5ac0e7bc720dcc094303a358ee1c7bbdcfc6447
2021-09-24 17:25:01 -07:00
Petr Pchelko
5afc62f258 Remove stub threshold feature
Bug: T284917
Change-Id: I5c9ea04a9deca136bb7210f07200d18f97fd6686
2021-09-13 09:26:38 -07:00
Umherirrender
07b499fbcf build: Update mediawiki/mediawiki-phan-config to 0.11.0
Addition and remove of suppression needs to be done with the version
update.

Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
2021-09-07 17:19:05 +02:00
Bartosz Dziewoński
0d53ca0bfb Fix exception in preferences when nickname is invalid and fancysig is on
Bug: T288151
Change-Id: I97141e03873eb98274cfa7b1ee79a83fe100b7f8
2021-08-27 17:55:30 +02:00
Umherirrender
1c60425468 parser: Fix string replacement in post-expand error handling
Change-Id: If5f40efd05816616d65fa8d78686914c1bbe185e
2021-08-26 21:24:53 +02:00
jenkins-bot
f533261dd4 Merge "Hard-deprecate Parser::mUser public access, Parser::getUser and ParserOptions::getUser" 2021-08-18 20:51:49 +00:00
Umherirrender
8926ae43bd Add comment to test-only functions in production code
Change-Id: I996f88012e8d61042c5bcd9cd72030e3020b3fa9
2021-08-17 21:15:15 +02:00
vladshapik
1091f7753f Hard-deprecate Parser::mUser public access, Parser::getUser and ParserOptions::getUser
Bug: T285713
Depends-On: Ie75c9cd66d296ce7cf15432e2093817e18004443
Change-Id: I4297aea3489bb66c98c664da2332584c27793bfa
2021-08-17 15:42:05 +00:00
Umherirrender
d1950d924a parser: Replace deprecated MWHttpRequest::factory
Change-Id: Id5fe298209cfbc09037799a2cdc117c9b7119172
2021-08-04 13:22:50 +00: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
Alexander Vorwerk
fa8ffed540 Parser::preprocess and ::preSaveTransform put one parameter per line
Makes it a bit easier to read and to add new parameters

Change-Id: Ica8df26144c48527a4cfd1828267e0e818097cf8
2021-07-11 21:12:16 +02:00
Arlo Breault
fdd8f864b8 Emit media structure as piloted in Parsoid
Gated behind the flag $wgParserEnableLegacyMediaDOM.  The scattershot
usage of it is a little unfortunate but isn't expected to live very long
so maybe that's acceptable.

Further details can be found at,
https://www.mediawiki.org/wiki/Parsing/Media_structure

Bug: T51097
Bug: T266148
Bug: T271129
Change-Id: I978187f9f6e9e0a105521ab3e26821e36a96b911
2021-06-24 23:32:40 +00:00
DannyS712
47d70dbfba Post Revision-removal cleanup
Updates for the removal of the Revision class itself
and the various methods/hooks/variables removed in the
process, including:

- Update some documentation removing most references
to the Revision class and updating the MCR migration
notes to reflect the past tense for Revision methods.

- Change some capitalization from "Revision" to "revision"
to make it clear comments are about revisions in general,
not the Revision class in particular.

- Minor code tweaks including removing unused variables that
were around for the old hooks that were removed, and
removing the use of DeprecatablePropertyArray where no
longer needed for anything.

- Fix incorrect documentation for PageUpdater::getStatus(),
the status value changed a while ago to have revision-record
in addition to revision, and recently to only have the
revision-record, but ironically PageUpdater was never updated.

- Removed Parser::$mRevisionObject, used to be a Revision object
and was deprecated in 1.35, missed earlier because it was no
longer being set to Revision objects, always null.

- Add RevisionRecord typehints in DummyLinker to match those
in the corresponding Linker methods

This should be a no-op in terms of functionality.

Bug: T247143
Change-Id: I03bbb94fc29085855448780b1a5ad9063911ecc4
2021-06-24 00:32:39 +00:00
Thiemo Kreuz
2ba01c7ee7 Remove some more comments that literally repeat the code
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.

Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
2021-06-18 21:23:56 +00:00
Thiemo Kreuz
51777ee8c1 Add and fix various type hints in PHPDocs
Random fixes I collected the past weeks in my local dev
environment.

Change-Id: Ic8a6262fd28e05cb57335f2faf390a47ff97dbaa
2021-06-18 08:19:23 +00:00
Petr Pchelko
92564edc7c Use Message::page instead of Message::title
Also modified new APIs added to ApiErrorFormatter to
use PageReference instead of Title.

Change-Id: I093c89f8e1e6d383603f887358be6ece70f23a02
2021-06-09 13:18:22 +00:00
DannyS712
8ec531f3c8 Add @since to some Parser methods
Change-Id: If8fd6fe6f0cf3aeaeb43e3fdccc774089b9c058e
2021-05-20 11:21:58 -07:00
jenkins-bot
f808e7dc4a Merge "WikiPage: Document triggerOpportunisticLinksUpdate and related code" 2021-05-05 22:41:05 +00:00
Timo Tijhof
481f1a49d6 WikiPage: Document triggerOpportunisticLinksUpdate and related code
== History of WikiPage::triggerOpportunisticLinksUpdate ==

* 2007 (r19095; T10575; b3a8d488a8)

  Introduces the "cascading protection" feature.

  This commit added code to Article.php, in a conditional branch
  where we encountered a ParserCache "miss" and thus have done a
  fresh parse. The code in question would query which templates
  we ended up using, and if that differed from what the database
  said (e.g. stored during the last actual edit or links update),
  then a new LinksUpdate is ad-hoc constructed and executed.

  I could not find it anywhere explicitly spelled out, but my best
  guess is that the reason for this is to make sure that if the page
  in question contains wikitext that trancludes a different page based
  on the current date and time (such as how most Wikipedia main pages
  transclude news information and "Did you know" information based on
  dated subpages that are prepared in advance), then we don't just
  want to re-render the page after a day has passed, we also want to
  re-do the links update to ensure the search index, category links,
  and "WhatLinksHere" is correct, and thus by extent, to make sure
  that cascading protection from the main page does in fact apply
  to the "current" set of subpages and templates actually in-use.

* 2007 (r19227; 0c0c0eff81)

  This adds an optimisation to the added logic that limits it to
  pages that satisfy `mTitle->areRestrictionsCascading()`.

  Thus for most articles, which aren't protected at all, we don't
  run LinksUpdate mid-request after a cache miss page view.

  Because of this commit, the pre-2007 status quo remained unaltered
  and has remains unaltered to this very day: We don't re-index
  categories and WhatLinksHere etc, unless an article edit or
  propagating template edit takes place.

* 2009 (r52888; 1353a8ba29)

  Introduces the PoolCounter feature.

  The logic in question moves to Article::doCascadeProtectionUpdates().

* 2015 (Iea952d4d2e66; df5ef8b5d7).

  The logic in question is changed, motivated by wanting to avoid
  DB writes during page views.

  * Instead of executing LinksUpdate mid-request, we now queue a
    RefreshLinksJob on the JobQueue, and utilize a newly added
    `prioritize => true` parameter.

  This commit also introduces a new feature, which is to queue
  RefreshLinksJob also for pages that do not have cascading
  protection, but that do satisfy a new boolean method
  called `$parserOutput->hasDynamicContent()`, which is set when
  the Parser encounters TTL-reducing magic words and functions
  such as {{CURRENTDAY}} and {{#time}}. For this new case, however,
  the `prioritize` parameter is not set, and this feature is disabled
  in WMF production (and other farms that enable wgMiserMode).

  This commit also renamed doCascadeProtectionUpdates()
  to triggerOpportunisticLinksUpdate().

  This commit also removed various documentation comments, which
  I've partly restored in this patch, the patch you're looking at
  now.

== Actual changes ==

* Rename hasDynamicContent() to hasReducedExpiry() and keep the
  previous method as a non-deprecated wrapper.

  This change is motivated by T280605, in which I intent to make use
  of a Parser hook that reduces the cache expiry. There are numerous
  extensions in WMF production that already do this, and thus the
  assumption that these have "dynamic content" is already false in
  some cases. I'm not yet sure how or if to refactor this so to allow
  reducing of the TTL *without* causing this side-effect, but as a
  first step we can make the method more obvious in its impact
  and behaviour.

  I've also updated two of the callers that I think will benefit from
  this more explicit name and (current) implementation detail.

Bug: T280605
Change-Id: I85bdff7f86911f8ea5b866e3639f08ddd3f3bf6f
2021-05-05 02:03:30 +01:00
DannyS712
f60ea069ba Remove remaining non-test uses of Revision objects
The following methods no longer support Revision parameters:
- CategoryMembershipChange::__construct
- ContentHandler::getUndoContent
- DerivedPageDataUpdater::prepareUpdate
- DifferenceEngine::getRevisionHeader

The following methods were removed entirely:
- Title::countAuthorsBetween

The following methods return arrays that formerly include
a 'revision' key that would emit deprecation warnings when
accessed and return a Revision object. The Revision object
has been removed from the arrays, and the 'revision-record'
key should be used to get the relevant RevisionRecord instead:
- PageUpdater::doModify
- PageUpdater::doCreate
- Parser::statelessFetchTemplate

The ParserOptions `templateCallback` option is a callback
that is called in Parser::fetchTemplateAndTitle() and should
return an array - the 'revision' key to that array used to
be a Revision object and was used if no 'revision-record'
was returned - it is now ignored.

Bug: T247143
Change-Id: I163ada88d649c75697aff4fa31a3a3c0bdef78b7
2021-05-04 13:10:22 -07:00
DannyS712
7bd7d2a6c1 Remove hooks that use Revision objects
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
2021-04-30 17:28:20 +00:00
jenkins-bot
b92d5e0e0e Merge "Document methods that may return StubUserLang instead of Language" 2021-04-30 04:36:32 +00:00
Umherirrender
e69f56fc9b build: Remove unneeded phpcs:ignore on false positives
False positives are resolved with the current release

Change-Id: I21986ec808edb341bf56abae8ee4e34e1559bc49
2021-04-29 23:50:07 +02:00
jenkins-bot
acb29985a2 Merge "Parser: remove Title from method signatures" 2021-04-29 18:28:28 +00:00
daniel
4880a82555 Parser: remove Title from method signatures
Bug: T281068
Change-Id: I3280e38dd82d71845c343eeb911e71dd33bb380b
2021-04-29 18:11:46 +02:00
Petr Pchelko
61599cd74a Clean up hard-deprecated Parser methods returning Revision
Bug: T278376
Change-Id: Ia4b5ab71c1df20e07dbfa3465be022225e8b44c1
2021-04-26 13:59:53 -07:00
Ammarpad
ed6450374b Document methods that may return StubUserLang instead of Language
Typehinting parameters that take the return value of these methods
with Language is not safe as they may return global $wgLang which
may or may not be instance of Language.

Bug: T278429
Change-Id: Ia5a71e4c39124f4427bd816e6e19207bb371cc6b
2021-04-19 12:50:14 +00:00
Bartosz Dziewoński
89eaaac661 Parser: Trim trailing whitespace as the last step in pre-save transform
It was accidentally removed in 2016 in commit
85034abca5.

Bug: T279964
Change-Id: I1da4d67143b86e7f852be7ccf3f16ae7b4f99bc4
2021-04-14 20:53:49 +02:00
jenkins-bot
cba20b9981 Merge "When the parser fetches revision content, guard against empty slots" 2021-03-18 11:51:15 +00:00