| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: Ib0e36d767788edcdd8fa9ebc5de6bbde4cf50f12
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This functionality exists to enable the anti-pattern of calling a
format method, without using its return value, and then subsequently
calling toString() to parse the same message, the same way, a second
time with the format you just called.
For example:
```
$msg = new Message('laggedreplicamode');
echo $msg->plain();
// <strong>Warning:</strong> Page may not contain recent
echo $msg->toString();
// <strong>Warning:</strong> Page may not contain recent
echo $msg->escaped();
// <strong>Warning:</strong> Page may not contain recent
echo $msg->toString();
// <strong>Warning:</strong> Page may not contain recent
```
Deprecate this rare anti-pattern in favour of using the return value
from the formatting methods such as $msg->plain() and $msg->escaped(),
or for compat we can also support $msg->toString('plain') etc.
This commit also fixes an unintentional lie in the assertion message
of one of the unit tests, which was claiming that toString() is
unaffected by format calls, when in fact it is. (And is what we are
deprecating here).
This implicit formatting and the related $this->format field will
be removed in 1.37.
Bug: T146416
Depends-On: Ia257621fb421854bf13e2965b04009663711ba0a
Change-Id: Ibb22099ff8042406e441d6c7fab87537d3ac92aa
|
|
|
|
|
|
|
|
|
|
|
| |
This is used quite a lot in the codebase and it's
a reason for a lot of usages of $wgLang. Time and date
seems generic enough to put into Message library -
we already have references to Wikimedia\Timestamp
library there.
Bug: T278482
Change-Id: If7cb5f5dcfa736b6530f731af9dc3af168812054
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the phpdoc of the Message class to encourage object creation
via MessageLocalizer::msg() instead of wfMessage() as the latter
results in calling to the global request context during message
parsing, which leads to unintuitive errors when sessions are not
available (in ResourceLoader callbacks or early hooks like
LocalUserCreated).
Also drop the documentation about the (long since removed) wfMsg*
methods.
Change-Id: Ie8c5c5e055cb8ff79d47d4c129df56f719e1cba6
|
|
|
|
|
|
|
|
|
|
|
|
| |
This issue type was globally suppressed in
I849ac4f120fd15b483e8939d4db45c98dc351259 to make reviewer easier.
This adds inline suppressions or @suppress directives on function
docs for false positives, mostly restoring those removed in
I849ac4f120fd15b483e8939d4db45c98dc351259
Bug: T231311
Change-Id: I1b1d814bd907e9d49fcc39f777982936574fc7c6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Taint check checks for possible security issues by tracking html
escaping and more by using phan.
This slows done the phan-job a bit and requires more ram
Keep the DoubleEscaped issues out to make reviewer easier
Adds suppression for false positives
Adds taint-annotation to help taint-check
Removes suppression for code phan now understand better by the tracking
of keys in taint-check
Fix some small issues by adding int cast or htmlspecialchars calls
Bug: T216348
Bug: T268920
Change-Id: I849ac4f120fd15b483e8939d4db45c98dc351259
|
|
|
|
|
|
|
|
| |
Also add taint for LogFormatter::makePageLink similiar to
LogFormatter::makeUserLink to avoid false positives as the return of
this function is mostly wrapped in Message::rawParam
Change-Id: Iab770702fd3a1d20f25f54057770dc03e28f1b0e
|
|
|
|
|
|
|
|
|
| |
Some function using union type string|Message where string is a message
key and not html. This can be marked as tainted to avoid double escape
issues from taint-check
Bug: T216348
Change-Id: I40a305b5e49d67b3f6d7737c0846b93a80b78fa9
|
|
|
|
| |
Change-Id: I02955f93b773868e067c577e9d497dd0bb428d5c
|
|
|
|
|
|
|
|
|
|
|
| |
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: If560596f5e1e0a3da91afc36e656e7c27f040968
|
|
|
|
|
|
|
|
| |
This annotates classes that can safely be instantiated by
extensions, per the Stable Interface Policy.
Bug: T247862
Change-Id: Ia280f559874fc0750265ddeb7f831e65fd7d7d6a
|
|
|
|
|
|
| |
is_array is called before is_scalar and arrays are not scalar
Change-Id: I73e65ac8bce95e31a2c5da7a48a212ce35fb4f40
|
|
|
|
| |
Change-Id: I94520b10d78a17ea8e965633dd475ea711f25c99
|
|
|
|
|
|
| |
It was removed in MediaWiki 1.27
Change-Id: I9d84d16371ee466064813b24ea855da82ff1e267
|
|
|
|
| |
Change-Id: I07fcc9529991adc634c10e5ed8498ac138a1c2b7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is currently notable overhead from having to call
Title::getPrefixedText/TitleFormatter upon serialisation,
and Title::newFromText/TitleParser upon unserialisation.
An unscientific benchmark:
> $start = microtime(true); $a = new RawMessage('some content');
> $a->title( Title::makeTitle( NS_SPECIAL, 'Badtitle/MessageCache' ) );
> $s = serialize($a); $b = unserialize($s);
> $duration = microtime(true) - $start;
> echo 'time: ' . round($duration * 1000, 1) . ' ms';
Run on mediawiki-docker-dev on PHP 7.2.28, via eval.php:
* Before: 129.7 ms, 118.6 ms
* After: 6.6 ms, 4.7 ms
Bug: T247035
Change-Id: I999db53e2f6189fb4319fefc2fbd8e5e5a228df0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This follows-up d83fcce5cb6, which did something similar for
includes/profiler/.
* Ensure presence of license header.
* Merge any file-level descriptions with the class block,
where it gets seen in generated docs about that class.
* Add any missing `@ingroup` tags to class blocks.
* Remove remaining `@ingroup` from file blocks.
These clutter the Doxygen pages with duplicate entries.
* Fix some misspelled words from 61e0908fa29 and f136c2953c62.
Change-Id: I5d21ec159766b799ba519da951d4f0716bae5f9f
|
|
|
|
|
|
|
|
|
|
|
|
| |
The coupling of Status with the global request context for
Message object creation is a common pain point in unit tests and
in no-session code. As a short term solution (until Status is
properly deprecated) allow injecting a different localizer.
Also refactor the code a bit to get rid if the explicit need for
the context language (which is already implicit in the localizer).
Change-Id: I82a2e4a83743546a934fb938b94e877a2471a3d2
|
|
|
|
| |
Change-Id: I11f8801ef47ec1a1f63d840116e69667e6f3ae3c
|
|
|
|
|
|
|
| |
These were all checked via codesearch to ensure that nothing is overriding
these methods.
Change-Id: Ie2d8c1fd01478f46f3d0d1259417182b0d955a12
|
|
|
|
|
|
| |
Bug: T231636
Depends-On: I78354bf5f0c831108c8f606e50c87cf6bc00d8bd
Change-Id: I58e67c2b38389df874438deada4239510d21654f
|
|
|
|
|
|
|
|
|
| |
And also update approximated counts, which for the most part are lower
than reported (hooray!)
Bug: T231636
Depends-On: Ica50297ec7c71a81ba2204f9763499da925067bd
Change-Id: I78354bf5f0c831108c8f606e50c87cf6bc00d8bd
|
|
|
|
| |
Change-Id: If05db9b55275246174b6f1fd0ca8437f271f5eea
|
|
Bug: T225756
Change-Id: Ica351483d83a3a912d58ebb194b30828541fbcf3
|