Commit graph

15 commits

Author SHA1 Message Date
Fomafix
73f94fd8cd Add type hint Language where possible
Also use ?? instead of ?: to check for null.

Change-Id: I058b61d7e06cdefecdafa82f60109cc386e2a809
2018-08-12 10:20:11 +02:00
Kunal Mehta
e0193327bd Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors
Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
2018-05-23 16:23:42 -07:00
jenkins-bot
732b5e2745 Merge "Use LogFormatter::getLinkRenderer in LogFormatter extensions" 2017-10-21 17:13:44 +00:00
Fomafix
6c30fab960 Use double quotes instead of singe quotes for HTML attributes
htmlspecialchars[1] encodes only double quotes not single quotes.
Therefor the HTML attribute must enclosed with double quotes for
correct output encoding.

[1] https://secure.php.net/manual/en/function.htmlspecialchars.php

Change-Id: I3fec5299585187ed70d62b9248007af34b0db85b
2017-07-26 22:56:52 +00:00
Matěj Suchánek
d0fa4e8d15 Use LogFormatter::getLinkRenderer in LogFormatter extensions
And additionally, migrate another two usages of deprecated
Linker methods.

Bug: T149346
Change-Id: I222da144a37f7d77eaf4bdde901b58c992f1af85
2017-07-12 09:58:18 +02:00
Bartosz Dziewoński
01936fa994 BlockLogFormatter: Durations are relative to block's timestamp, not Unix epoch
Also fixed legacy code in LogFormatter producing messages for IRC feed.

Bug: T55907
Change-Id: I0df19574f74210a91ce72c79188b6618f04ef9a2
2017-01-18 13:21:56 +00:00
Haikal Izzuddin
2c657ec256 Replace Linker::link() usage with LinkRenderer
Bug: T149346
Change-Id: Ie384566617f18ad6c3bf836b39702365d59f714d
2016-12-01 12:04:38 -08:00
umherirrender
afd72226b8 Show absolute block expiry in user timezone on block logs
For this add an user parameter to Language::translateBlockExpiry.
This allows the function to display the absolute block expiry in the
user's time zone. Use this when formatting block log entries.

This also avoids the use of $wgUser

Bug: T131241
Change-Id: If0a1d3c88bb4242a016eb9b2df115413de786149
2016-04-09 20:57:33 +02:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Vivek Ghaisas
c54766586a Fix issues identified by SpaceBeforeSingleLineComment sniff
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
2015-09-26 23:06:52 +00:00
umherirrender
9a504d18fb Always set duration/flags of type block for new api logparam style
Old and very old log params may omit a duration or flags. Always adds
these parameters to the output.
Also simplify the infinity check (see also
I5eb68c1fb6029da8289276ecf7c81330575029ef) and check the return of
strtotime.

Bug: T92902
Follow-Up: I6846ce09322eb404c506b5a51780a44ce9279fe2
Change-Id: I9109a27f416b002e5c562a1454d8c373dcf98fb4
2015-04-17 19:57:18 +02:00
Brad Jorsch
61233fc847 API: Move parameter formatting into LogFormatter
This allows for extensions to format their log entry parameters, and
keeps the code for formatting API log entry parameters in the same place
as for other formatting.

This also takes the opportunity to rearrange the output format slightly
to avoid conflicts like what's happening in T73020.

Bug: T35235
Bug: T73020
Bug: T91466
Change-Id: I6846ce09322eb404c506b5a51780a44ce9279fe2
2015-04-17 04:59:41 +00:00
umherirrender
52bf90f41c Fix log message for blocks without duration
Very old blocks form 2004 have not any log_params and therefor enforce a
duration of infinite to be shown on Special:Log.

Follow-Up: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
Change-Id: I4bdfab1ff865501a780ed0c7c50e2b1bab467a4b
2015-03-16 20:51:05 +01:00
umherirrender
ce4af8b873 Fix parameter order for block logs
The new block log params does not known the message number 4 (which is
index 3), therefore LogFormatter::getMessageParameters adds empty index
to keep the sequence in strong order.
But the loop was starting at index 4, not 3, which skips the needed
empty index 3 for the order.

Due to the missing $4 the legacy log params returning index 3 and 4,
therefore move them one up to match the new numbers.

Also fixed undefined index warnings for api's list=logevents

Follow-Up: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
Change-Id: Ie23be129ee2bd1d2bf753c3b5cba293d64b8e0e8
2015-02-24 19:37:03 +01:00
umherirrender
c891ff00ed Migrate block log to new log system
This allows use of gender on Special:Log.
Old messages are kept for use in IRC.
A test was added to ensure an unchanged IRC message.

Bug: T57402
Change-Id: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
2015-02-07 21:02:10 +01:00