With a user-friendly error message which uses both technical and
non-technical language, without the irrelevant detail of filebackend
URLs.
Bug: T283045
Change-Id: I8704f405d38acdffae7bd4ea5b91f3f591fc2ebc
* Replace `substr`/`substring` with `slice`. The second argument
to `substring` is length, not end index as in `substr`/`slice`,
so convert where necessary.
* Replace `new Date().getTime()` with `Date.now()`
* Documentation fixes
* Replace `throw Error` with `throw new Error`
Change-Id: I532500ea4c99d8ebec01efb21273c8df21626e59
The null check for the class property packageFiles needs change to
check the return value of the function instead, because Phan would
report an issue that a null value is used in the foreach.
Phan does not understand the relation between the return value and the
class property.
When using a local variable then Phan can check
that the value is never null when used.
Change-Id: I48ac8a8fe55ae7b4e13bc94d2f2d2ede01fbc68b
phan says that $this->mainCollator is not documented to get null
assigned.
Use a local variable to check for null and than set the class property.
Change-Id: I000c935da8d99184f2ae0382fc5caac81e80c8d7
Replace assert.(not)ok/(not)equal with strict equality checks:
assert.true/false/(not)strictEqual.
Will be enforced in upcoming eslint-config-wikimedia release.
Change-Id: I4a9523b72834524a4b4e4339d5b175a8346a646c
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
Clean up loose ends from the skin table of contents patch (I44045b3b9).
* Clarify $options -> $skinOptions (because there are so many different
"options" classes!)
* Remove redundant default when Article::doOutputFromParserCache()
calls ParserOutput::getText() -- the 'injectTOC' option defaults
to true inside ParserOutput::getText() as well.
Bug: T287767
Followup-To: I44045b3b9e78e7ab793da3f37e3c0dbc91cd7d39
Change-Id: I04b8d8a4076df551347ec6d6599d597424a2dadf
Since 1.34 setting non-default HTTP engine
has been deprecated. It's time to remove
the old implementations. Only Guzzle is
now available.
Change-Id: I978b75827e69db02cbc027fe0b89a028adfc6820
Use getTitle() in FileDeleteAction, it's the same as using the old
$this->file.
Use a single showForm method for both classes, and a separate method to
add handy links. When switching to FormAction, the former will be
replaced by getFormFields(), the latter by postText(). However, before
doing that, the following things should be addressed:
- The onArticleConfirmDelete hook, which allows changing the reason.
This hook should be replaced in the long term, but for now it might be
sufficient to add it to the common UI logic and only run it for
non-file pages.
- The horrible $hasHistory hack. This is going to be a tad more
complicated because we need to remove it from WikiPage and
ContentHandler, and replace it with something else.
Bug: T288282
Change-Id: I965c32457b1426ece9781221a95337d295b9e1a2
The following User methods, deprecated in 1.37, have been removed:
- ::resetIdByNameCache,
- ::getStubThreshold,
- ::matchEditTokenNoSuffix,
- ::changeableByGroup
- ::changeableGroups,
- ::isAllowUsertalk
ActorStore::clearCaches() has been removed, since User::resetIdByNameCache
has been removed. User::$mAllowUsertalk has been removed, since
User::isAllowUsertalk has been removed.
Bug: T277511
Change-Id: I608a5277924fc50cc3d9fca6ba958bc6d9c321d0
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
The restrictions were introduced in r53480 (724411c7ca, 2009),
which makes it clear that this was just about HTML correctness,
and in HTML5 there are fewer requirements.
This code was last touched in commit fd6e9ef2d4 (2017), where it was
suggested in code review that it "can probably be removed":
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/362326/comment/6e71af52_900abad4/
Bug: T126962
Change-Id: I54c1f28ec9112cd4a161a79e76c2224f91f134b9