Commit graph

2405 commits

Author SHA1 Message Date
Ppchelko
2bcb3fe567 Revert "Move limit report rendering to ParserOutput"
This reverts commit 89028e0b8e.

Reason for revert: Temporary until we deal with T295357

Change-Id: I556de18dbf900a9bc58d5ae22d1bf194682d0840
2021-11-09 15:57:18 +00:00
Petr Pchelko
89028e0b8e Move limit report rendering to ParserOutput
This does not move the actual limit report data into
ParserOptions yet, that should be done separately
given that it will require serialization changes.
Let's get this change settled first before messing
with serialization.

This unifies canonical and non-canonical ParserOptions,
so ParserCache can now be used with both. It is hard
to say how this will affect the ParserCache capacity,
so we should monitor it after releasing this.

Change-Id: I154c0a77a5b0287b5572614d56339fb57ac56c33
2021-11-08 12:45:41 -08:00
C. Scott Ananian
059e62cde6 Regression fix: do language conversion on ToC in ParserOutput::getText()
We moved the ToC insertion from the parser to ParserOutput::getText()
in T287767 but forgot to ensure that the ToC contents are properly
language converted -- this happens *after* the call to
ParserOutput::setTOCHTML() in the old Parser code.

This is a quick and dirty fix, which does the language conversion
but probably misses a few corner cases of the original behavior
(marked by XXX comment).  For example, it doesn't disable language
conversion on interface messages -- but there shouldn't be any
ToC on interface messages.  Not heeding __NOCONTENTCONVERT__
in the article is a legit problem, but probably not as bad as
the UBN regression we're fixing.  We'll clean this up in
a followup (T295209), but it will involve passing some additional
information from the Parser to ParserOutput which won't be
present in "old" parser cache entries anyway.

This is an UBN and this patch is the quickest way to ensure that
existing parser cache content renders correctly.  It's
preferable to the alternative
(Iffcff96fd9b4749794ac78414c1801979a652792) which handles all the
corner cases but can't fix up existing parser cache content,
which has "always" been stored without language conversion.

Bug: T295187
Change-Id: Ic14b3a49a8ee7ed600485d4f8a363a206035a847
2021-11-05 23:59:10 +00:00
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
ffb0dfc87b Hard deprecate ParserOutput::addWarning()
Code search:
https://codesearch.wmcloud.org/deployed/?q=%5BOo%5Dutput%28%5C%28%5C%29%29%3F-%3EaddWarning&i=nope&files=&excludeFiles=&repos=

Other uses in non-production code:
Id96ba92b46ae57a385b7096a02a63ad5eddf566e (BlueSpiceBookshelf)
I8eb6733d676a56f6a03b9798d3c4022493c01d04 (PageInCat)
I9cb8d36caf4326b3c3d02362cd06f2d4093b5a8e (TEI)

Bug: T293515
Depends-On: I352d161dc276c6684b0532b62c0e676a4d05cdfd
Depends-On: Ib51c75e38b9bf490b4ded481ee92ede0949f272e
Change-Id: I99cfbfbecf134366d1a97e67c46d0abc0af22d26
2021-10-15 16:27:24 -04: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
8979eb0c57 Mark ParserOutput::getAllFlags() @internal
This function, added in 1.34, does not appear to be used outside core:

https://codesearch.wmcloud.org/search/?q=-%3EgetAllFlags\%28\%29&i=nope&files=&excludeFiles=&repos=

It currently exposes representation details of ParserOutput (that is,
whether a boolean flag is stored in an explicit property, in the
$mFlags array, or in the $mExtensionData array) and so it would be
best not to expose it outside core so as to facilitate any future
change in the internal representation of ParserOutput.

Bug: T292868
Change-Id: I7b6d309425ff01dc211334b848068d0b9c0f9261
2021-10-15 14:24:54 -04:00
C. Scott Ananian
6bf78153bf Hard deprecate ParserOutput::addTrackingCategory()
Non-WMF-deployed patches:
I403b646852064fed22e8e9bbfadd221990363881 (CollaborationKit)

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

Depends-On: I339a14907c8059c52ffce5d8a554e97f1f0b58d6
Depends-On: Ie6a09796b908dd105ec17d5a1f0f9586eed9bd8c
Depends-On: I983d370a03413086acafe7e67a2b812400e1a38d
Depends-On: Ie41ad70f1fb5de202355314a96a1243234fb267c
Depends-On: I715f788c5026a6c07d4995980a4fcc6c8b84e2b4
Depends-On: I1330a806febf898b3a0a2998fac857f0f737a0a3
Change-Id: I340c138f26e25ce971a46470a4da02d011b5a638
2021-10-15 14:18:26 -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
C. Scott Ananian
06fe601bf2 Hard deprecate ParserOutput::{get,set}CategoryLinks()
There are no uses in deployed Wikimedia production code.

The following patches are to other users:

I55f4325073cc01a706708b0391f2561090075be6 (BlueSpiceEchoConnector)
I244e5740ca02d05164553799cf0dab94a0b5c197 (NoCat)
I1602650991121dceb62d57c1f5b10359213183db (PageInCat)
https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/5094 (SemanticMediaWiki)

Code search:
https://codesearch.wmcloud.org/search/?q=-%3E%28get%7Cset%29CategoryLinks%5C%28&i=nope&files=&excludeFiles=&repos=

Bug: T287216
Change-Id: I6b472f20b7d90b5be7f485f20b91821e2d756944
2021-10-15 09:57:13 -07:00
C. Scott Ananian
5ae946d3a6 Rename ParserOutput::setCategoryLinks() and ::getCategoryLinks()
Make ::setCategory() consistent with the corresponding singular method,
which is ::addCategory(), not ::addCategoryLink().  Also, don't return
a value.

This renaming is in preparation for factoring out a write-only base
class from ParserOutput suitable to be used by Parsoid.

Note that OutputPage does distinguish a 'category link' from a
'category list', and there are separate OutputPage::getCategories()
and OutputPage::getCategoryLinks() methods.  However, the category
map in ParserOutput isn't exactly the same as either of these:
it's actually a map (or list of pairs) of category name to sort key.

Rename ParserOutput::getCategoryLinks() to ::getCategoryNames()
in order to clarify that the concept involved is not the same as
the OutputPage "category links" methods.

Code search:
https://codesearch.wmcloud.org/deployed/?q=-%3E(get%7Cset)CategoryLinks%5C(&i=nope&files=&excludeFiles=&repos=

(Note that many of the code search matches are for the methods in
OutputPage, which we are trying to disambiguate here.)

Bug: T287216
Change-Id: Idb383d3d9ef7b76f8a0208a057a3cb8c639465c9
2021-10-15 09:45:36 -07:00
jenkins-bot
65f67552e6 Merge "Hard deprecate the renamed ParserOutput::*Property() methods" 2021-10-14 19:26:28 +00: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
jenkins-bot
5b7558cd2a Merge "Replace deprecated Language::getConverter in CoreParserFunctions" 2021-10-14 16:33:57 +00:00
jenkins-bot
8ab400e920 Merge "Sanitizer: Replace RFC 3454 by RFC 8264 for clearUrl" 2021-10-14 16:15:44 +00:00
jenkins-bot
388e5f200c Merge "Sanitizer: Use \u{xxxx} syntax in cleanUrl" 2021-10-14 16:07:43 +00:00
Umherirrender
468721ab07 Replace deprecated Language::getConverter in CoreParserFunctions
Bug: T252095
Change-Id: I536543c516bf952967ada17cc781a9d125421b3e
2021-10-14 16:06:24 +00:00
jenkins-bot
2504a3bb68 Merge "ParserOutput: remove Title from public interface" 2021-10-14 16:02:28 +00:00
daniel
845b36c7bb ParserOutput: remove Title from public interface
Usages of Title in the public interface of ParsrOutput are being
replaced with LinkTarget or PageReference, as appropriate.

Change-Id: I571cf18fd7e666a59ef3947b09c2e75357bcac04
2021-10-14 10:46:53 +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
jenkins-bot
7b84b2bed6 Merge "Hard-deprecate ParserOutput::preventClickjacking()" 2021-10-13 22:16:31 +00:00
Petr Pchelko
a1aa3e0827 Hard-deprecate all public property access on CacheTime and ParserOutput.
- Added a test where ParserOutput objects with CacheTime
properties set are unserialized from previous versions.
- Generate new serialization tests for 1.38

Now all serialization in production is JSON, so changing
property visibility shouldn't affect ParserCache.

Bug: T263851
Depends-On: I283340ff559420ceee8f286ba3ef202c01206a23
Change-Id: I70d6feb1c995a0a0f763b21261141ae8ee6dc570
2021-10-13 13:27:16 -04:00
C. Scott Ananian
5050208ed0 Hard-deprecate ParserOutput::preventClickjacking()
Follow up to the soft deprecation in I9822c60c180d204bd30cb4447a1120155d456da4.

Code search:
https://codesearch.wmcloud.org/deployed/?q=%28allow%7Cprevent%29Clickjacking&i=nope&files=&excludeFiles=&repos=

Note that the dependencies here are actually cleanups to
OutputPage::preventClickjacking(), not ParserOutput::preventClickjacking().
It can be hard to tell the difference between these two methods when
reading code (especially when parameter types are omitted) and so we're
being extra cautious by cleaning up both of these together.

Bug: T287216
Depends-On: I626e89a1bff2d9c535b828a5b25eff863c91f858
Depends-On: I23e8b35540d2da34c0a3d335069c518b4b72a333
Depends-On: I2538ac8f37fcde183f496e49a8de0ed25a38e508
Change-Id: I0f9b1fe755f7d3d6a9b18fa21a738dda7566c211
2021-10-13 16:32:29 +00:00
xiplus
59b2f57b13 Fix regex typo
Fix regex for no-conversion marks.

Change-Id: I1f9216a859bf91324c5943202c303c59f1a88595
2021-10-13 14:39:36 +08:00
jenkins-bot
ec3ab502f9 Merge "Convert TrackingCategories to a service with DI" 2021-10-09 00:19:26 +00:00
DannyS712
b9663bed45 Convert TrackingCategories to a service with DI
Bug: T247194
Change-Id: I50012e2a5e65aeee7671023d2fd5367e21e8ae67
2021-10-08 16:36:20 -04:00
jenkins-bot
cd9c0ba6c0 Merge "Rename ParserOutput::{get,set,unset}Property to {get,set,unset}PageProperty" 2021-10-08 14:47:30 +00:00
C. Scott Ananian
5b515cfaf0 Hard deprecate the renamed ParserOutput::*Property() methods
Code search:
https://codesearch.wmcloud.org/deployed/?q=%5BOo%5Dutput-%3E%28get%7Cset%7Cunset%29Propert%28y%7Cies%29%5C%28&i=nope&files=&excludeFiles=&repos=
https://codesearch.wmcloud.org/deployed/?q=%5BOo%5Dutput%5C(%5C)-%3E(get%7Cset%7Cunset)Propert(y%7Cies)%5C(&i=nope&files=&excludeFiles=&repos=

Bug: T287216
Depends-On: I2eed4a8215c58a7b7e2443f5e17d007f1cd9cf87
Depends-On: I6076142623fd82dfc4243bbc16ea770635ee8c32
Depends-On: Ifd70418bf2f8f443c9b396b4b674a5a025b595a5
Depends-On: I43954809cd53d3c97fe20651e3de00ad1d3a4d59
Depends-On: Ic6c677679459ff2d1c500d4885431d38058eaed0
Depends-On: Ide0188576f005e0435229cc1e9c01dce68a2f657
Depends-On: I1633f6fa00193df6ea1d6633de07bc8d2b269cbf
Depends-On: Id4581c6c45f9fc4690900a30d8172951bc461a1b
Depends-On: I551a6d33cb24edc8a1b699bf5ac6775cb7ebe9d7
Depends-On: Ifefda53c70d97238290f2d6e735721ce75707050
Depends-On: I7f1b9fe5cfc34c37e9745b9c9118b0e13e94f200
Change-Id: Iad0181850c956d7bb59cf3b0315cf3a3848f9cab
2021-10-08 10:32:46 -04: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
Subramanya Sastry
f70b15558f Get rid of ParserOptions::setTidy()
Bug: T198214
Change-Id: I90ea6ce6831caa92e5d88d843132161a5fc66184
2021-10-07 15:13:59 -05: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
jenkins-bot
5bfcf89757 Merge "parser: Add @since to Parser::getUserIdentity" 2021-10-04 17:01:09 +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
df3cc40fac Rename ParserOutput::{allow,prevent}Clickjacking() -> ::{get,set}PreventClickjacking()
This name is consist with the rest of the setter and getter methods
in ParserOutput.  Renamed the methods in OutputPage, ImageHistoryList,
ImageHistoryPseudoPager, and ContribsPager as well for consistency;
it also makes chasing down lingering references in codesearch easier.

Soft-deprecated the old name for 1.38.  Hard-deprecation will follow,
but there are a number of users in production that should be chased
down first.

Code search:

https://codesearch.https://codesearch.wmcloud.org/deployed/?q=(allow%7Cprevent)Clickjacking&i=nope&files=&excludeFiles=&repos=

Bug: T287216
Change-Id: I9822c60c180d204bd30cb4447a1120155d456da4
2021-10-01 14:13:47 -04: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
C. Scott Ananian
169f0e16da ParserOutput::isLinkInternal(): make @internal
This method is used only twice outside this class: in ParserOutputTest
(which can use the standard backdoor to access private members) and
in the advancedbacklinks extension (which should just cut-and-paste
the code, it's quite small and has no dependencies).

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

Bug: T287216
Change-Id: Iddc7f7b691be2cb97a5dba60de7037e2b12206dc
2021-09-29 16:35:25 -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
jenkins-bot
2a124ae15b Merge "Remove hard-deprecated methods returning User from Parser" 2021-09-27 20:16:07 +00:00
jenkins-bot
eaf10f600b Merge "Expand local URLs to absolute URLs in ParserOutput" 2021-09-27 14:48:02 +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
Cindy Cicalese
eed48e402b Detect and monitor against multiple Parser invocation during edit requests
Bug: T288707
Change-Id: I0cca8f9bcf1d6e964b8b06c0c4490e83f4fb1de5
2021-09-23 16:12:40 -05:00