Commit graph

4410 commits

Author SHA1 Message Date
Siebrand Mazeland
8a02a4b4fd Call static functions statically in API
Change-Id: I5952acb932c1e7337dc85226a898da3472e799e9
2016-03-08 16:11:02 +00:00
Siebrand Mazeland
33ba3bea02 Use Elvis operator where possible in API
Change-Id: I0a26c04cf2ded2c1bd74d8dabd131ae8e20117f3
2016-03-08 16:10:23 +00:00
Siebrand Mazeland
94afc567d6 Remove unused local variables in API
Change-Id: Ia94ae232308ad47ee88dbd30675cfcbdb6b371ed
2016-03-08 16:52:00 +01:00
Translation updater bot
adaf3d221f Localisation updates from https://translatewiki.net.
Change-Id: I11fb4866b2fc0c5daf9ee639d42feef2cdafe768
2016-03-07 21:59:57 +01:00
Translation updater bot
ee683c821e Localisation updates from https://translatewiki.net.
Change-Id: I683765945022afc8b9b4a839ab28f47f79d86f69
2016-03-06 21:51:01 +01:00
Translation updater bot
7ab19abd82 Localisation updates from https://translatewiki.net.
Change-Id: Ib49bf89dcc309086e521635db1198fe39e46b995
2016-03-05 22:41:56 +01:00
Translation updater bot
0fcde80db7 Localisation updates from https://translatewiki.net.
Change-Id: I62572d292497e21e7ffcaf6b8ab2524f469360a6
2016-03-04 22:11:18 +01:00
jenkins-bot
996b7350f3 Merge "Add tags support to patrol, protect, unblock, and undelete" 2016-03-03 16:28:45 +00:00
Timo Tijhof
ee1d97b3cc api: Fix "PHP Notice: Undefined variable: config"
Follows-up 362c220aa1, which split the method up but didn't
re-create a local $config variable.

Change-Id: Ic32ac3c600d0b4d69e8129fa50ea47d9a6a54b20
2016-03-02 21:54:43 +00:00
jenkins-bot
d86fd79066 Merge "Convert remaining array() to [] in API" 2016-03-02 02:27:58 +00:00
Translation updater bot
ee96182185 Localisation updates from https://translatewiki.net.
Change-Id: I7c15b259b0f88dbc05ce1520ecb319a66eed6f73
2016-03-01 21:18:57 +01:00
jenkins-bot
d5a36875a7 Merge "Allow API action=logout with BotPasswords" 2016-03-01 11:12:20 +00:00
Brad Jorsch
00658d6800 Allow API action=logout with BotPasswords
Since login is handled specially, do the same for logout.

Bug: T128335
Change-Id: Ib3b12d7045449b5c44f5ff7d1ecfce14416e8400
2016-03-01 02:26:45 +00:00
Reedy
9b91df2d48 Convert remaining array() to [] in API
Change-Id: Ib44d59ff0cf0d6d8efc462671cac716dbead8ffc
2016-02-29 22:51:36 +00:00
Geoffrey Mon
e70c4eb664 Add tags support to patrol, protect, unblock, and undelete
- Add 'tags' parameters to appropriate API modules
- Add tag-adding logic to appropriate functions that carry out
  relevant functions
- ManualLogEntry::{set,get}Tags to handle adding tags to log
  entries in a cleaner fashion
- Use ManualLogEntry::setTags in LocalFile::recordUpload2

Bug: T97720
Change-Id: I98c52da7985623bfdafda2dc2dae937b39b72419
2016-02-29 16:59:31 -05:00
Translation updater bot
ba9333f79f Localisation updates from https://translatewiki.net.
Change-Id: I5da9bd040f15c0ded7c5b507c36f6d31a1dd049a
2016-02-29 22:28:03 +01:00
jenkins-bot
310cdcd39a Merge "Add request error state to ApiBase::logRequest" 2016-02-29 16:49:00 +00:00
jenkins-bot
4d9803dcbf Merge "Update ApiAction logging channel values" 2016-02-29 16:41:08 +00:00
Bartosz Dziewoński
c161c46d26 Improve code suffering from PHP 5.3's lack of support for foo()[]
I searched for /\$(\S+) = (.+?\(.*?\);)\n.*?\$\1\[/, ignored
everything involving isset(), unset() or array assigments, then
skimmed through the remaining results and changed things where they
made sense. These changes were not automated, so please review them.

Change-Id: Ib37b4c66fc57648470f151ad412210b3629c2538
2016-02-28 22:49:20 +01:00
Translation updater bot
6f594c4202 Localisation updates from https://translatewiki.net.
Change-Id: I17a79c788bb4cb2c4674bb8f82e723d90ef62d29
2016-02-27 21:21:37 +01:00
jenkins-bot
4772f4452a Merge "Allow more fine-grained throttling of login attempts" 2016-02-26 22:40:15 +00:00
jenkins-bot
34610b59ed Merge "ApiQuerySearch: Match limits to those in Special:Search" 2016-02-26 09:45:23 +00:00
Translation updater bot
d23c47331d Localisation updates from https://translatewiki.net.
Change-Id: I0aad8636bb230609aa260cdbebe7d10114c2236b
2016-02-25 21:50:50 +01:00
Brad Jorsch
ce3d55d6b7 ApiQuerySearch: Match limits to those in Special:Search
The limits were decreased in r55615, but no one seems to remember why.

Bug: T119189
Change-Id: I622203195ed5dbed9548bb4a9a6acdab8e3bc3ed
2016-02-24 16:22:39 -05:00
Brian Wolff
6fcfa98154 Allow more fine-grained throttling of login attempts
In addition to the 5 attempts every 5 minutes rule, add some long
term rules. Its extraordinarily unlikely that a non-malicious person would
use the wrong password 150 times in a row, so add a rule that you
can't have 150 login fails in a row in 48 hours all from the same
IP address. Also add the ability to set throttles across all IPs, but
do not set any of these types by default (There is an unclear risk/benefit
tradeoff between making it easy to lock someone out of their
account in a DoS attack, and preventing brute-forcing)

Bug: T122164
Change-Id: I5c279906936ef3991a42fc21325c3ffd4a200493
2016-02-23 18:02:35 -05:00
Translation updater bot
d651abc99d Localisation updates from https://translatewiki.net.
Change-Id: I2d18d11d274f565e92623563b5f0550a5ed527c1
2016-02-22 21:24:10 +01:00
Reedy
95b2be3bd3 Fix function call casing
Change-Id: I20600c865b9f239ac281a1f8c5776ad4dbec4359
2016-02-22 18:30:33 +00:00
jenkins-bot
62ec66bb11 Merge "Use hex2bin() instead of pack()" 2016-02-22 17:18:00 +00:00
jenkins-bot
a103e82647 Merge "Remove some unused variables" 2016-02-22 17:03:23 +00:00
Translation updater bot
222814598b Localisation updates from https://translatewiki.net.
Change-Id: I9d1b78ddb3fa02956e4b01c137691cf6f290b958
2016-02-21 21:57:15 +01:00
Translation updater bot
3a595014a7 Localisation updates from https://translatewiki.net.
Change-Id: I80bb2ffabf103ac061320924ff1bee7f6c13769c
2016-02-20 21:46:29 +01:00
Reedy
f8a58fa67e Remove some unused variables
Change-Id: Ia3a290555f06c564c063591710380367a04cb1cc
2016-02-20 20:22:56 +00:00
Kevin Israel
6492c009ef Use hex2bin() instead of pack()
This function was added in PHP 5.4.0 and can be used now that MediaWiki
only works with PHP 5.5.9 or higher.

Also fixed a bug in ApiQueryCategoryMembers::validateHexSortkey() that
allowed a single line feed at the end of the string to pass.

Change-Id: I5b577e7dcc5fb6a06ab550429aae657dbcc79083
2016-02-20 00:27:24 -05:00
Translation updater bot
49b06bc91d Localisation updates from https://translatewiki.net.
Change-Id: I72d9974730d1ae1dfbd1b02968a9e1dfab71b525
2016-02-19 21:49:58 +01:00
Bryan Davis
362c220aa1 Add request error state to ApiBase::logRequest
Add a boolean indication of the error status of an API request and
a list of error codes to the log event emitted to the 'ApiRequest' debug
log channel.

Bug: T113672
Change-Id: I694a3000bab0d569dfe41d711f05121b917e6104
2016-02-18 15:53:50 -07:00
Translation updater bot
dbab0702e0 Localisation updates from https://translatewiki.net.
Change-Id: I3dece5b748fbe9b4c57cbf823c60f8464ccf8de3
2016-02-18 21:52:46 +01:00
Bryan Davis
c1d7f2ccc7 Update ApiAction logging channel values
Update the data values and naming conventions for structured API logging
on the ApiAction channel to match recommended conventions for log events
being recorded to Wikimedia Foundation analytics storage.

Bug: T108618
Change-Id: I94c730f196bb8629cac9408e61139fab79a34f8d
2016-02-18 13:46:08 -07:00
jenkins-bot
601112660b Merge "ApiQueryWatchlist: wlshow=unread should filter revisions, not pages" 2016-02-18 18:40:19 +00:00
Translation updater bot
3427a3f822 Localisation updates from https://translatewiki.net.
Change-Id: Ic6d74b8085cf4b940f82bcf03a49b207e319c965
2016-02-17 22:24:10 +01:00
Brad Jorsch
027658bd87 ApiQueryWatchlist: wlshow=unread should filter revisions, not pages
It's currently showing all relevant revisions from pages with at least
one unread revision, where it would be more sensible for it to show just
the unread revisions. Something similar applies to wlshow=!unread.

Bug: T125729
Change-Id: I552901efb98081af9a1a677f4403a2a1a73bd94f
2016-02-17 15:50:35 +00: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
Translation updater bot
ab5efb6186 Localisation updates from https://translatewiki.net.
Change-Id: I845f2abb9f2c602be7a8acb732a25c6c85ac2b36
2016-02-16 22:41:11 +01:00
Florian
d237380021 Fix not-loaded DbPageLanguage when Title::getPageLanguage() get's called
If the Title object isn't the title of the current viewed WikiPage, the page_lang
field of the database isn't requested. This results in the problem, that
Title::getPageLanguage() always returns the default content language, even if
the page language is different (changed with Special:PageLanguage, if
wgPageLanguageUseDB is true). That is problematic for the Translate extension,
which relies on the correct page language.

This change makes sure, that getPageLanguage() always return the correct page
language. If the page language isn't loaded already, Title::getPageLanguage()
now does a database lookup (if $wgPageLanguageUseDB is true) to get the correct
page language. It will use LinkCache for the page_lang field.

Bug: T121666
Change-Id: I0ae5ea39f7a124ed427ca5dfb26c1a116b27a94e
2016-02-16 20:37:40 +00:00
jenkins-bot
f51b34c9d3 Merge "Converted ApiQueryPageProps to use PageProps; added multi-property query to PageProps." 2016-02-16 18:59:43 +00:00
Cindy Cicalese
86c08b2401 Converted ApiQueryPageProps to use PageProps; added multi-property query to PageProps.
Change-Id: Icd4540001e044052ae5759c87c8b83a70ab5c30f
2016-02-16 13:39:47 -05:00
Bartosz Dziewoński
05c2c65ab9 Allow users to tag file uploads
Using either action=upload API or Special:Upload. (No user interface
is provided for the latter, this is meant to be used by on-wiki
scripts/gadgets enhancing the upload process.)

Modelled after how ae3ab9eef0
implemented tagging of regular edits.

Bug: T121876
Change-Id: Ia3e0dbd895b2f8bc66985b24db35f112b6f9a22d
2016-02-16 03:51:29 +01:00
Translation updater bot
732492c169 Localisation updates from https://translatewiki.net.
Change-Id: I405dcc02cb6945d940efd6bfaace6e102ad1f0eb
2016-02-15 21:12:06 +01:00
Translation updater bot
9e730711a6 Localisation updates from https://translatewiki.net.
Change-Id: Ic7986269d1f22ba1260e6c931020852dbe20e216
2016-02-14 21:19:19 +01:00
Translation updater bot
259f606c5b Localisation updates from https://translatewiki.net.
Change-Id: If8a45c13a53d80dd04d39926980411a2c9af5bbe
2016-02-13 22:47:11 +01:00
Translation updater bot
604e84550f Localisation updates from https://translatewiki.net.
Change-Id: I2c3440378f1a706985d7e5a2093a395a226c6297
2016-02-12 21:47:56 +01:00