Commit graph

106571 commits

Author SHA1 Message Date
jenkins-bot
3710b3ad2a Merge "Deprecate ParserOutput::addWarning() in favor of ::addWarningMsg()" 2021-10-16 01:17:13 +00:00
jenkins-bot
a3534987db Merge "Add new ParserOutput::{get,set}OutputFlag() interface" 2021-10-15 23:28:45 +00:00
jenkins-bot
ae5c51f354 Merge "Use Message::sizeParams to simplify code when building messages" 2021-10-15 23:21:38 +00:00
jenkins-bot
733ec79540 Merge "Mark ParserOutput::getAllFlags() @internal" 2021-10-15 23:02:42 +00:00
jenkins-bot
bcb74c38bc Merge "Hard deprecate ParserOutput::addTrackingCategory()" 2021-10-15 22:20:09 +00:00
Alexander Vorwerk
5aa1bf33f6 Make PageEditStash::checkCache() accept an UserIdentity
This allows using the already into PageEditStash injected UserFactory
instead of falling back to global state in DerivedPageDataUpdater.

Change-Id: I18f198d323c3ca001c6a0de91bc669180cd1d11c
2021-10-16 00:16:20 +02:00
jenkins-bot
3cf6ab6e52 Merge "Move ::addTrackingCategory() implementation to TrackingCategories" 2021-10-15 20:52:13 +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
jenkins-bot
8d9046310d Merge "Improve TitleWidget search results" 2021-10-15 19:03:54 +00: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
jenkins-bot
6442290b4e Merge "Hard deprecate ParserOutput::{get,set}CategoryLinks()" 2021-10-15 17:59:20 +00:00
jenkins-bot
be7f3056ec Merge "Rename ParserOutput::setCategoryLinks() and ::getCategoryLinks()" 2021-10-15 17:59:14 +00:00
Kunal Mehta
cc241c2add Allow using a reverse proxy for local HTTP requests
$wgLocalHTTPProxy can be used to configure a reverse proxy
for requests to domains in $wgLocalVirtualHosts. The previous
implementation of using it as a proper HTTP proxy is no longer
supported and has been reverted out of REL1_37 (856da72363d1ba8bf).

It sets the hostname of the request as a "Host" header, scheme as
"X-Forwarded-Proto" and then sets the proxy's scheme, host and port as
those of the request.

Bug: T288848
Change-Id: Ibc3616f5ad925d464d937ab15461a88619c8b7a7
2021-10-15 10:56:46 -07:00
jenkins-bot
23fa9dfb65 Merge "RELEASE-NOTES-1.38: Re-write to be more useful & keep to standard form" 2021-10-15 17:43:12 +00:00
jenkins-bot
57a7f3472d Merge "Remove NS_IMAGE and NS_IMAGE_TALK from DumpNamespaceFilter" 2021-10-15 17:33:39 +00: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
James D. Forrester
8384c72a0c RELEASE-NOTES-1.38: Re-write to be more useful & keep to standard form
Instead of a paragraph of prose listing things that are now gone, give
an actual list, and match the method with the replacement, rather than
having people have to scan each option.

We don't use the term 'hard deprecation' in user-facing documentation.

Change-Id: I9c4ac0bcf4464bbc28f4e6eb1a4c2bd2693f5668
2021-10-15 09:45:35 -07:00
bwang
5ef1f785c8 Ensure the search input element has a aria-label by default by updating 'html-input-attributes'
Change-Id: I175ae29310a7432212a7b9c1c68dac9923665536
2021-10-15 10:18:37 -05:00
Kevin Israel
8408d4de47 Always encode spaces in cookie values as "%20"
I think the backward incompatible change to PHP (to no longer decode
plus signs in cookie values as spaces) was not properly justified, since
the cited RFC does not specify how a server should decode the value of a
cookie. Nevertheless, the change happened, so we work around it:

- Update setCookieEmulated() to match PHP 7.4.3, by using rawurlencode()
  instead of urlencode(). While tildes are no longer encoded as "%7E",
  that difference does not break backward compatibility.
- setCookieEmulated() is only called under PHP 7.2, and only if the
  SameSite attribute is set. Keep it that way by using an alternative
  workaround when possible: pass the return value of rawurlencode() to
  setrawcookie().
- This change only fixes the bug with respect to newly set or updated
  cookies. To fix the bug with respect to existing cookies, I wrote a
  backward compatible cookie parser and intend to commit it separately.

Bug: T291127
Change-Id: I7920ff4bbc7f8516d76daa2b39c585d02706cacd
2021-10-15 04:40:53 -04:00
Sam Wilson
84ef41addb Improve TitleWidget search results
Add the query value as a redlink in the result list,
as is already done if the query value is *not* a prefix
of some other (existing) title.

Bug: T291056
Change-Id: I1569ad5a57cd98fe7deb034512b46e948a3561e1
2021-10-15 09:47:48 +08:00
Fomafix
df729bc7ae Merge "mediawiki.rcfilters.filters.ui: Simplify ItemMenuOptionWidget" 2021-10-14 23:52:27 +00:00
jenkins-bot
6f8e9f9680 Merge "tests: MWHttpRequestTest is a unit test, not an integration test" 2021-10-14 23:45:14 +00:00
jenkins-bot
71be145b96 Merge "AllMessagesTablePager: Avoid double class mw-datatable" 2021-10-14 21:45:49 +00:00
jenkins-bot
2303886bc9 Merge "Add $wgParserEnableLegacyMediaDOM to REL1-37 release notes" 2021-10-14 20:41:34 +00:00
Fomafix
bff33f9f48 mediawiki.rcfilters.filters.ui: Simplify ItemMenuOptionWidget
* Remove unnecessary check for an empty array.
* Use .map() instead of .forEach() and .push().
* Combine .addClass() calls.
* Avoid eslint-disable-next-line mediawiki/class-doc.

Change-Id: Ia3c27ff08a5e7148af42d8e67f2ccc586227b6c6
2021-10-14 20:24:33 +00:00
jenkins-bot
ba70412496 Merge "Add message parameter type for User Groups" 2021-10-14 20:12:19 +00:00
Arlo Breault
b770956968 Add $wgParserEnableLegacyMediaDOM to REL1-37 release notes
Bug: T51097
Change-Id: Iabc092b643bfb9d6bc90559f230ae6a84f6d544d
2021-10-14 16:03:27 -04:00
Umherirrender
fe7bd754ee objectcache: Change variable name from master to primary
Change-Id: I3574ea348f32ccd289a0b4158fe93b5cb48ddffa
2021-10-14 19:40:01 +00:00
jenkins-bot
65f67552e6 Merge "Hard deprecate the renamed ParserOutput::*Property() methods" 2021-10-14 19:26:28 +00:00
TChin
fb4e7a803a Add message parameter type for User Groups
Bug: T278482
Change-Id: I45da5f73f8920b79b57c02776a05d0268d3480f2
2021-10-14 15:02:13 -04:00
Fomafix
e86f180bd4 Merge "Encode & to & 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
4ed5508f02 Merge "Move parser test with stray carriage return to extraParserTests.txt" 2021-10-14 16:46:51 +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
jenkins-bot
b281141368 Merge "Final sync of DeleteAction and FileDeleteAction forms" 2021-10-14 06:24:48 +00:00
jenkins-bot
f32e15c3f1 Merge "Make Parser::$mStripState private" 2021-10-14 03:10:56 +00:00
jenkins-bot
ec09bc8071 Merge "Remove cookie settings from mw.config" 2021-10-14 03:08:54 +00:00
Timo Tijhof
15964c6682 mediawiki.base: Add tests for mw.log.deprecate()
Bug: T292489
Change-Id: Iad4ea58a53ca3a97f57a36684eb1c8bc0e2996bf
2021-10-14 01:14:04 +00:00
jenkins-bot
fc01b20346 Merge "Rename linter-pager-* messages to avoid conflict with Linter extension" 2021-10-14 01:06:25 +00:00