The "error" class nowadays is only supposed to be used by Parser and
related code. It renders as red text with no special formatting.
Instead use Html::warningBox(), which renders a yellow box around the
text. (Not Html::errorBox(), because these are not really errors.)
Change-Id: I7a7046bf9b9765cbb82ec3caa1530de7f05e0da4
As far as I can tell, outside of test cases, every single time we call
OutputPage::enableClientCache() we pass it `false` and actually mean to
*disable* the client cache. Create a new less-confusingly-named method
and deprecate the old one.
Change-Id: I7c89e20528a0d91173f0edcb997dcae631935ee5
This is for page-recent-delete and db-replicated should not be used for
this. Simply use the standard and common service providing the same
functionality.
Bug: T272512
Change-Id: Iabaffd726370f5a580097819fd854da82bf43907
This reverts commit 2bcb3fe567.
Reason for revert: this is a good change,
just needed more work to not break CI
Change-Id: I23768bee242e3cf81b1493a740cf070e7ad1e224
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
* 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
Move all output-related code from Article to DeleteAction.
Article::doDelete is now deprecated, because there are some callers in
the wild, although I don't think any caller should need it.
Kill some ancient-PHP-style pass-by-refs that are useless and only make
the code more error-prone for both the caller and the callee.
Bug: T288282
Change-Id: Ic1de0ed8ebba15da5ed9f5cd11625017360a7672
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
New option 'absoluteURLs' was added to getText method
of the ParserOutput object that replaces all links
in the page HTML with absolute URLs.
Removing the action=render special case from Title
seems safe cause we will end up replacing the result
with absolute URL if we're in a render action no matter
where Title::getLocalUrl was called from.
This change is safely revertable from the perspective
of ParserCache.
Bug: T263581
Change-Id: Id660e1026192f40181587199d3418568f0fdb6d3
This is just moving code verbatim, removing now-unneeded stuff, and
duplicating tests as well.
Bug: T290021
Change-Id: I540ddaaa11dfabcf0b87b608b151b5e34d199fd8
Add 'rev_suppressed_text' failure message to avoid reusing
'rev-deleted-text-permission' for both deleted and suppressed edits.
Additionaly fix qqq documentation of 'rev-deleted-text-permission':
It's used in both privileged and unpriviliged context. The log link
it has links to public log.
Also fix qqq doc of 'rev-suppressed-text-permission': It's only
shown in privileged context. The log link it has links to private
log
Bug: T282203
Change-Id: Iffcbe9d62c2b2947ebb086579f87d977d8a5eb3d
Per docs added in I18767cd809f67b, these don't need normalization
as they are only compared against predefined strings, and besides
are generally entered manually in a form, and even then would not
require the kinds of Unicode chars that have multiple/non-normalized
forms.
In nearby areas to also fix some trivial cases:
* getVal('title') obviously needs normalization.
Use getText() to make this more obvious.
* getVal() compared against simple string literals within the code
obviously don't need normalization (e.g. printable === 'no').
* Change hot code in MediaWiki checking for whether 'diff' or 'oldid'
are set to getCheck (which uses getRawVal) instead of getVal.
As a bonus this means it now handles values like "0" correctly,
which could theoretically have caused bad behaviour before.
Change-Id: Ied721cfdf59c7ba11d1afa6f4cc59ede1381238e
This is the first patch in that direction, and for now, the code is
**only moved** with minimal changes, to keep the diff small and make it
easier to review. More patches will be sent to clean up this code,
before moving parts of it to a separate service.
Article::delete() and friends were hard-deprecated, given the lack of
callers according to codesearch (searched in "Everything").
The logic for varying the form depending on the page type is also being
moved to DeleteAction, which means there's currently no way for
extensions to customize that (and I couldn't find any extension doing
that at the moment). Should we need this behaviour, we could add a hook to
DeleteAction to allow altering the form.
Bug: T288282
Change-Id: I34525cf3e7c9a82032101b8c2e7b14d6dff59092
This is the first patch in that direction, and for now, the code is
**only moved** with minimal changes, to keep the diff small and make it
easier to review. More patches will be sent to clean up this code,
before moving parts of it to a separate service.
Article::delete() is being removed since there's going to be no
reasonable way to maintain BC, and it's also unused (which I think is
expected, given how many things that method would do).
The logic for varying the form depending on the page type is also being
moved to DeleteAction, which means there's currently no way for
extensions to customize that (and I couldn't find any extension doing
that at the moment). Should we need this behaviour, we could add a hook to
DeleteAction to allow altering the form.
Bug: T288282
Change-Id: Iadb8137d728f4fd4e749a1052f8aef4bab11ec09
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
When calling PermissionManager::isBlockedFrom, don't query the
primary database when only showing UI elements.
Bug: T283268
Change-Id: I9a79badf8a7cfb6afc7b4d12e4f1fbb5c24b6a86
Instead of always (except when reading from ParserCache),
using the latest version.
This can also clearly be seen by visiting an old revision on
Wikipedia (https://en.wikipedia.org/w/index.php?oldid=N)
and looking for "This page was last edited on …". When first
loading the old revision, the TS of the last rev will be shown,
upon reloading, the correct time will be shown (as the output
is fetched from parser cache).
This reverts the test removals from I83a43d651.
Bug: T282648
Change-Id: I517d4970d5c682489f27a65ba01ee30db9c62276
This should not default to latest revision id, but
Article::getRevIdFetched() if the ParserCache doesn't
have the id set. Also set the revision id before calling
OutputPage::addParserOutput to make sure the id is
already set when the "OutputPageBeforeHTML" hook is run
(which is the case in other code paths).
Additionally I've made the tests more robust, by no
longer manually getting the revision into parser cache.
Bug: T281587
Change-Id: I999195441f9d75a7e4bde4d843ad7729cdb1bee0
In order to allow Authority to know about user blocks,
we need a narrow interface to represent such blocks.
This deprecates some methods on AbstractBlocks in favor
of new methods on the Block interface that avoid binding to
the User class.
Bug: T271494
Change-Id: I7bb950533970984a014de0434518fbbefb695131
- EditPage::$mBaseRevision
- EditPage::getBaseRevision()
- Title::getFirstRevision()
- LinksUpdate::setRevision()
- LinksUpdate::getRevision()
- Article::$mRevision
- Article::getRevisionFetched()
- WikiPage::getOldestRevision()
- WikiPage::getRevision()
- ContribsPager::tryToCreateValidRevision()
To make things easier, instead of rewritting
the Revision tests that were using WikiPage::getRevision,
just delete them, its not worth the effort to rewrite
them since the class is going away. For the WikiPage
tests, replace uses of getRevision with getRevisionRecord,
manually converting to a Revision object where needed
Bug: T247143
Change-Id: I52bc1f49649f8bd25797e3f7a090bec9c63ac2d1