Commit graph

399 commits

Author SHA1 Message Date
jenkins-bot
0cba0ba56b Merge "LogEventsList: Don't output '0000-00-00' as default date" 2018-11-14 15:29:58 +00:00
Bartosz Dziewoński
6b328a5975 LogEventsList: Don't output '0000-00-00' as default date
It is an invalid value that should be (by spec) ignored by the
browser, but apparently some browsers don't ignore it, and when they
submit it back, it is converted to -0001-11-30 by our date parsing.

Bug: T209490
Change-Id: I2643767a0091c1c9db78706358903e1dc97b59d1
2018-11-14 15:49:22 +01:00
Volker E
b6a6c7fdf7 Special:Log: Use OOUI
Bug: T117737
Change-Id: I1a7028a35359d507f699c77a69b09853d45362f5
2018-11-10 17:10:08 -08:00
jenkins-bot
ecee5cd7c7 Merge "Use PHP 7 '??' operator instead of if-then-else" 2018-10-24 21:58:04 +00:00
Dayllan Maza
f24991c6ed Add partial block details to block-log entries.
Block information needs to be more detailed if a block is not
sitewide. With this change, page restrictions will be visible
as part of the block information in Special:Contributions,
Special:Block, and Special:Log and via API

Bug: T197108
Change-Id: I5d2ef606f709bdd60bf52e2a048890b0f6360fca
2018-10-24 00:47:27 +00:00
Fomafix
43244db9a2 Use PHP 7 '??' operator instead of if-then-else
Change-Id: If9d4be5d88c8927f63cbb84dfc8181baf62ea3eb
2018-10-21 21:46:46 +02:00
Brad Jorsch
993baa3493 ActorMigration: Remove possibility of read-both
When this was originally written, the plan was to read both the old and
new fields during the transition period, while stopping writes to them
midway through. It turns out that the WHERE conditions to do read-both
correctly are generally not handled well by the database and working
around that would require a lot of complicated code (see what's being
removed from ApiQueryUserContribs here, for example).

We can simplify things greatly by instead having it write both fields
during the transition period, reading from the old for the first part
and the new for the second part, as is being done for MCR.

Bug: T204669
Change-Id: I4764c1c7883dc1003cb12729455c8107319f70b1
Depends-On: I845f6ae462f2539ebd35cbb5f2ca8b5714e2c1fb
Depends-On: I88b31b977543fdbdf69f8c1158e77e448df94e11
2018-10-11 12:12:00 +11:00
Umherirrender
40d3ce8d17 Reduce calls to MediaWikiServices::getInstance()
In some functions MediaWikiServices::getInstance() was called twices or
in loops. Extract the variable to reduce calls.

Change-Id: I2705db11d7a9ea73efb9b5a5c40747ab0b3ea36f
2018-08-18 06:02:39 +02:00
Aryeh Gregor
e68fdb4065 Mass conversion to SpecialPageFactory service
Change-Id: Ia6e1e819ec6cbe8bf75b820109f51d47863e31fc
2018-08-17 12:03:12 -07:00
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
Aryeh Gregor
90d4f56fe4 Mass conversion of $wgContLang to service
Brought to you by vim macros.

Bug: T200246
Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
2018-08-11 22:44:29 -06:00
jenkins-bot
e96b9055fb Merge "LogFormatter: Fail softer when trying to link an invalid titles" 2018-08-08 15:35:56 +00:00
Prateek Saxena
5161ee2a65 LogEventsList: Stop showing deprecation warning when $input is empty
Follows-up on I697e158887fcca1da88763a4c929a981d9211490

Bug: T201006
Change-Id: I140cde3f71e2bd8106f0c0ce7da1ec822a8da072
2018-08-07 13:30:13 +05:30
jenkins-bot
62fa503bc3 Merge "Force phan-taint-check to think LogFormatter stuff is safe for html" 2018-08-02 10:15:50 +00:00
Bartosz Dziewoński
26bb9d9b23 LogFormatter: Fail softer when trying to link an invalid titles
Old log entries contain titles that used to be valid, but now are not.

Bug: T185049
Change-Id: Ia66d901aedf1b385574b3910b29f020b3fd4bd97
2018-08-01 16:19:55 +02:00
Bartosz Dziewoński
23cd9d6d2e Prefill date in form on Special:Log when calling with old parameters
When the date is specified using &year=...&month=... URL parameters
rather than &wpdate=..., HTMLForm can't automatically fill it in,
but we can explicitly specify the default.

Bug: T199856
Change-Id: I71f4953d57a3893190778e5bd763db108dc433d3
2018-07-26 22:11:52 +02:00
Jayprakash12345
593f2f4276 Prefill username in form when calling Special:Log/<username>
Bug: T200446
Change-Id: I3f2fcedee8440d5943e556f7c1c06dfb1085e549
2018-07-26 22:20:56 +05:30
jenkins-bot
4db9564e50 Merge "LogEventsList: Correct typo" 2018-07-24 01:54:31 +00:00
jenkins-bot
8ef9135781 Merge "LogPager: Add backwards-compatibility for hide_[type]_log URL params" 2018-07-23 20:55:21 +00:00
Bartosz Dziewoński
5f7bf1942b LogEventsList: Correct typo
The parameter to getTitleInputDesc() is actually unused, so this was
not breaking anything.

Change-Id: Ia301faf511e30b4fc4542ccb80b24cf807cf731c
2018-07-23 18:18:04 +02:00
Prateek Saxena
f8a777b903 LogEventsList: Use DerivativeContext
Bug: T200136
Change-Id: Ie2b7753684dc0257b0b53d9c9314feeb14d99182
2018-07-23 09:52:36 +05:30
Prateek Saxena
8aaa50b6ef LogPager: Add backwards-compatibility for hide_[type]_log URL params
Also, the $default value in LogEventsList#getFiltersDesc was not
being generated properly and would have always been an empty array.

Bug: T199856
Change-Id: Id286c76259406521f12cda67a4a715032e022637
2018-07-20 07:18:46 +05:30
Max Semenik
9b0c621d7f Deprecate wfArrayFilter() and wfArrayFilterByKey()
Now that all our supported PHP versions have array_filter()
with a third parameter, these functions aren't needed anymore.

Depends-On: I3b097a1a048baabcaca15dc214a3a1bb06e746cc
Depends-On: I0187e27ac47cbab099249572201d1a649226a734
Change-Id: I7cabd0252691a083cb749cf9d3a7a23f1d076c39
2018-07-19 08:40:46 +02:00
jenkins-bot
a55a6f2424 Merge "LogEventsList: Remove options not used by HTMLForm" 2018-07-19 02:25:04 +00:00
jenkins-bot
6934d1db03 Merge "LogEventsList: Add backwards-compatibility for log-show-hide messages" 2018-07-18 21:03:59 +00:00
Bartosz Dziewoński
6205c06ebe LogEventsList: Remove options not used by HTMLForm
HTMLForm gets the input value from the request. The values
specified in the form descriptor were never used. (You can specify a
default value, but that uses the 'default' key anyway.)

Change-Id: I27934e1118492371e547dd5e94feb172a0510cc9
2018-07-18 19:55:07 +02:00
Prateek Saxena
682e4464a1 LogEventsList: Use GET in HTMLForm
I missed this during conversion.

Follows-up on Iba3c6aa5ac40dcdee0792c2d045b238b02d76521.

Bug: T199856
Change-Id: If3f228425b217c9ccdb7d32e0bc899647797ed70
2018-07-18 10:39:33 +05:30
Prateek Saxena
cab5b3afc7 LogEventsList: Add backwards-compatibility for log-show-hide messages
Also updated the release notes.

Bug: T199657
Change-Id: I027effbc7bd797ee241281ddd57334a5dc5c8a57
2018-07-18 09:49:36 +05:30
Prateek Saxena
52c62c65cd LogEventsListGetExtraInputs: Keep $input and add $formDescriptor
Follows-up on Iba3c6aa5ac40dcdee0792c2d045b238b02d76521.

Bug: T117737
Bug: T199495
Change-Id: I697e158887fcca1da88763a4c929a981d9211490
2018-07-17 20:35:55 +02:00
jenkins-bot
48a72eee82 Merge "Special:Log: Convert to HTMLForm" 2018-07-12 11:10:22 +00:00
jenkins-bot
ef97002179 Merge "Simplify PHP by using ?? and ?:" 2018-07-11 09:09:18 +00:00
Fomafix
6866cfec37 Simplify PHP by using ?? and ?:
Also remove not necessary surrounding parentheses.

Change-Id: I0eb5c9c1bdfb09a800258379cdcefb5fd4d3d21c
2018-07-10 20:03:17 +00:00
Prateek Saxena
38756eae46 Special:Log: Convert to HTMLForm
* All Xml generation code has been removed.

* The LogEventsListGetExtraInputs hook now needs a form
  descriptor array and not plain HTML.
  See I37e0d3e81a46239750465b9299279fbbd7c7f87a.

* LogPager and LogEventList also take the $day parameter
  for 'From date (and earlier)' and pass it to getDateCond
  as well.

* Since FormOptions can't automatically extract the date
  from the request this is being done manually in the
  execute method of Special:Log using MWTimestamp.

Bug: T117737
Change-Id: Iba3c6aa5ac40dcdee0792c2d045b238b02d76521
2018-07-10 16:55:33 +05:30
Brian Wolff
6b19444b32 Force phan-taint-check to think LogFormatter stuff is safe for html
Whether or not LogFormatter::getActionText() and friends are safe
for html depends on the runtime value of LogFormatter::$plaintext
which is beyond the abilities of phan-taint-check's static analysis
to determine. Thus this method results in a lot of false positives.

To prevent that, add an annotation that marks the method as always
safe for html. This is not ideal, but refactoring this method while
maintaining back-compat looks like it would be very challenging.

Bug: T197002
Change-Id: I9aded350ed4acc733b4fb697dd3400686a178fa9
2018-07-08 16:56:37 +00:00
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
Matěj Suchánek
1000236bb9 Prevent "Undefined offset notice"
The number provided by the query can be arbitrary, so let's narrow the
input validation to booleans.

Bug: T194616
Change-Id: If03e6e2d5bbcf4f2d85047cc23ee5388b39fe114
2018-06-29 07:42:36 +00:00
Fomafix
125cbd8c01 Use \u{00A0} instead of &#160; or &nbsp;
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0) instead of
the HTML/XML entities &#160; or &#xa0; or &nbsp;.

With the UTF-8 character the generated HTML is shorter and better to read.

Also change the special value for the label in HTMLForm from &#160; to
U+00A0 but also support &#160; for backward compability.

Bug: T154300
Change-Id: I882599ac1120789bb4e524c4394870680caca4f4
2018-06-24 01:20:13 +00:00
jenkins-bot
7261721e55 Merge "Link to revisions and log entries from tag logs" 2018-06-12 15:21:22 +00:00
Matěj Suchánek
209b24c427 Link to revisions and log entries from tag logs
Bug: T142888
Change-Id: Ieccd6a831a6231c1f3e83ba311eac65f956fe2ec
2018-06-08 13:38:57 +00:00
Max Semenik
6e956d55aa Replace call_user_func_array(), part 2
Uses new PHP 5.6 syntax like ...parameter unpacking and
calling anything looking like a callback to make the code more readable.
There are much more occurrences but this commit is intentionally limited
to an easily reviewable size.

In one occurrence, a simple conditional instead of trickery was much more readable.

This patch finishes all the easy stuf in the core, the remainder is either unobvious
or would result in smaller readability gains. It will be carefully dealt with in
further commits.

Change-Id: I79a16c48bfb98b75e5b99f2f6f4fa07b3ae02c5b
2018-06-07 20:19:26 -07:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Bartosz Dziewoński
52b0799e8d Use PHP 5.6 constant expressions for some bitfield constants
I searched the entire codebase for 'const' and looked for things
that looked suspiciously like manually calculated bitfield unions.
As of PHP 5.6, we can have them calculated automatically when
defining constants.

Change-Id: I7d971d1a63f8916db2f8f6c053c7dd0a13add92d
2018-05-30 18:05:18 -07:00
Kunal Mehta
e0193327bd Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors
Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
2018-05-23 16:23:42 -07:00
Kunal Mehta
b332aa879d Use LinkRenderer instead of deprecated Linker in LogPage
Change-Id: Ia31706cbbffd1d03916b6c087cc3a6b218e83fe6
2018-05-20 14:05:00 -07:00
Bartosz Dziewoński
286cdb8382 LogPager/LogEventsList: Correct docs about $pattern parameter
$pattern is a boolean, it is documented as "Do a prefix search rather
than an exact title match". However, its type was incorrectly
documented to be a string, and the default value was '' instead of
false (which was harmless, as it is correctly treated as a boolean
value everywhere).

Change-Id: Id093d12891a231d5934f9908e619065afff7380e
2018-05-10 19:46:59 +00:00
jenkins-bot
4f4a620f8e Merge "Add 'logid' parameter to Special:Log" 2018-05-04 02:56:08 +00:00
Sam Wilson
8e04e60113 Add 'logid' parameter to Special:Log
Make it possible to get a URL for a single log entry,
as an alternative to using Special:Redirect/logid/123.

The existing single-log-entry link of Special:Redirect/logid/123
is also simplified to be a redirect to this new parameter.

Bug: T191608
Bug: T187638
Change-Id: I5f2e52531cd2ba617a25570e40aa8c5168e284d9
2018-05-04 09:52:55 +08:00
Kunal Mehta
6066f6c063 Declare LogFormatter::$parsedParameters property
And rework LogFormatterTest so it doesn't need to access that property.

Change-Id: I4d429430efe74dc083019a1a8bb07257785484b9
2018-05-01 19:56:13 -07:00
jenkins-bot
c2f9376c19 Merge "RecentChange: Use constants for the $noudp parameter of save()" 2018-04-30 19:47:24 +00:00
Kaldari
2f713d5ff8 Better class documentation
Change-Id: I25912f38bb483cd4636bff4ce219dc878a1046f3
2018-04-29 11:54:24 -07:00