- No linking when the user cannot see the suppressed revision
- Double-strike the timestamp (b6f148b)
Bug: T325450
Change-Id: If94e9655d72e59a2b9d5147c5c2338e98f0ad163
It misrepresents the users contribution to show empty text for a
revision when in fact the revision contained some text which we later
lost.
Also, errors from SqlBlobStore::fetchBlobs() did not stop a cache entry
from being written, so a subsequent cache hit would show the bad
revision as empty.
So, in Storage:
* Add BadBlobException, which is thrown by the Storage layer to
indicate that a revision is marked as bad.
* Have SqlBlobStore::getBlobStore() return an error for bad blobs
instead of an empty string.
* Duplicate the check for flags=error into SqlBlobStore::expandBlob().
This avoids an unnecessary cache fetch, and avoids making
decompressData() throw on error, which would be a b/c break.
* In SqlBlobStore::getBlob(), suppress the cache when there was an
error.
In Revision:
* Add BadRevisionException, to wrap BadBlobException in the Revision
layer.
* Return null from RevisionRecord::getContent() on a broader set of
errors. Make it mostly non-throwing.
* Add RevisionRecord::getContentOrThrow() which returns a non-nullable
Content.
* Note that SlotRecord::getContent() returns a non-nullable Content so
now throws in more cases.
In the UI:
* In Article::view(), catch the exception and show an error message.
* In DifferenceEngine, catch the exception and make a suitable error
message available via getRevisionLoadErrors(). In the diff page, show
the error message in a box.
* In ApiComparePages and the legacy rvdiffto, show a warning.
* In RawAction, show a 404 by analogy with other error cases.
* In EditPage, there was already handling for $content=null with an
appropriate error message (missing-revision-content). But having
$this->textbox1 = null caused PHP 8.1 deprecation warnings, so I fixed
that.
* In EditPage undo, there was already handling for null content, but I
improved the error message: "does not exist or was deleted" seems more
appropriate than "conflicting intermediate edits".
Change-Id: Idd1278d6d756ef37d64addb7b5f3be30747ea603
In 81f69c2, I have only removed the callers. The method is
now dead code and should have been removed as well.
Change-Id: I556ed5398435f4d3a5f400e07e4819dd16e0df06
When setting causeAgent for jobs, be specific.
When creating parserOptions, call setRenderReason.
This allows us to capture statistics on what actions cause jobs,
renders, and cache writes.
Change-Id: Iaef64beadce1489bebb6bb00855c3ba6013a29d8
PHP 8.1 adds single quotes to the list of encoded characters when
htmlspecialchars() is called with no flags. That's usually harmless,
but this instance breaks an extension test. So use ENT_NOQUOTES which is
optimal for text which is not inside a tag or attribute.
Bug: T322099
Change-Id: I3a2c385771b3f00a38a238bf745bd2997be60a9c
This patch only adds and removes suppressions, which must be done in the
same patch as the version bump.
Bug: T298571
Change-Id: I4044d4d9ce82b3dae7ba0af85bf04f22cb1dd347
Mainly, document some parameters as non-empty-array so that phan knows
the list of arguments won't be empty when unpacking.
In EditPage, account for hooks potentially unsetting the copyright
notice.
Also rewrite some code in LogPager, so it's hopefully easier for phan to
understand what's going on.
Change-Id: Ic0638571554424098d0743db32dd46723a08e103
We rely on the default settings for `skin` and `injectTOC` set by
OutputPage::addParserOutputText(), and so no longer need to explicitly
initialize these from the skin options.
Bug: T317333
Depends-On: Ica30569efbb5730eff5b807e8fc34beb2e13e74f
Change-Id: I5b8ecd1abf87e66bb75d7c26790f9e7c1b3a6da3
Previously, OutputPage::isRevisionCurrent() would check a replica
database, potentially different from the database used to fetch the
revision being displayed, according to OutputPage::getRevisionId().
Now the data for both functions is provided in the same way.
Bug: T314684
Change-Id: I266d643d1eed931df346889f43d72d42e5f4a3ba
Using the same rationale as for its parent class, Diff: ideally there
should be some kind of factory for diffs, but currently, there isn’t.
Reuse the same task ID for the todo comment (T257472), as we think it’s
appropriate for both “diff” classes, Diff and WordLevelDiff.
Note that the TwoColumnConflict extension already uses this class as if
it were newable.
Bug: T311224
Change-Id: If2553d6ebc96636b83df8f58e0420dd7eb6ba5af
Co-Authored-By: Michael Große <michael.grosse@wikimedia.de>
This edition brought to you by:
grep -ERIn $(grep -o "'[A-Za-z0-9_]*'" includes/MainConfigNames.php | tr
"\n" '|' | sed 's/|$/\n/') includes/
I only corrected a fraction of the results provided by that command. I'm
submitting the partial patch now so it doesn't bitrot.
Bug: T305805
Change-Id: If1918c0b3d88cdf90403921e4310740e206d6962
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
The functions returning null or the class property is set explict null.
Some function should not accept null or return null.
Found by phan strict checks
Change-Id: Ie50f23249282cdb18caa332f562a3945a58d86ff
The functions returning null or the class property is set explict null
Found by phan strict checks
Change-Id: I4a271093fb6526564d8083a08249c64cb21f2453
The purpose of all these changes is not only to make the code
shorter, but to make it more readable.
Notable:
* Fix wrong type hints.
* The `foreach ( $roles )` loop was processing everything twice.
* Inline preg_replace_callback() callbacks.
Change-Id: I2b8146946ab6966cc6f047556a0a898624af181a
Default comment is added to changelist rows that have no comment/edit
summary. This affects history and diff pages as well contributions page.
The default comment is hidden by default.
Bug: T298645
Change-Id: I2982a69886a90797b2a658df13db9780e88b871c
For Special:Diff/prev/1234567890 the message is
2 revisions of this difference (0 and 1234567890) were not found.
The 0 is not helpful
Change-Id: I6bada64c8cffb4e653ea7a46c31fb014fd6b862f
This reverts commit ef458e8948.
Reason for revert: Causes page tabs to disappear on Special:WhatLinksHere.
Bug: T297744
Change-Id: I0ee282a9f7a5a9b2cfdc3261d800d9e27eaf977e