Commit graph

51318 commits

Author SHA1 Message Date
addshore
86adcfb8b7 @covers tags for maintenance tests
Change-Id: Ica5f351f71ee5fccae97560f2de6d75fc5da721b
2013-10-24 19:12:22 +01:00
Tyler Anthony Romeo
96a9a3e101 Fix double-parsing of account creation messages.
Account creation messages don't need to be parsed. This is
a temporary fix to follow up when double-parsing was accidentally
added in 69ea440003 (I402c6bebcfe).

Bug: 44718
Bug: 52191
Change-Id: I333d5468820994625348316ebf6c57d4df025284
2013-10-24 10:16:19 +00:00
addshore
2a982e0e13 Cleanup skins/SiteBarTest and @todo/covers
Change-Id: I501d04ddbeee23539337b68142ee6c1371a63d98
2013-10-24 10:10:37 +00:00
addshore
4bb09bbca5 @covers for all GlobalFunc tests
Also split 2 tests off into their correct test classes,
this methods are clearly no longer global functions

Change-Id: I482433f3099e72507a766e85d9576ff36e58b9ad
2013-10-24 10:00:55 +00:00
Brad Jorsch
c800638273 Improve linkprefix regular expressions
The regular expression in the linkprefix message is run against the
entire page up to each wikilink, and is expected to capture one group
having everything except the prefix and another having only the prefix.
For long pages this winds up being a lot of text, so inefficient regular
expressions are going to cause problems.

The current regex is this:

  /^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD

This is not efficient: it will scan through the string trying to match
against every run of one or more letters/non-ASCII characters,
backtracking at every one except possibly the last. The only reason this
hasn't been a huge problem everywhere is because only a few languages
have this feature enabled.

This change replaces this with this regex:

  /^((?>.*(?<![a-zA-Z\\x80-\\xff])))(.+)$/sD

This is rather more efficient: it will grab the whole string (which is
actually fast even for huge strings), then back off character by
character until it finds one that isn't a letter/non-ASCII.

Note that the above could be simplified somewhat:

  /^((?>.*[^a-zA-Z\\x80-\\xff]|))(.+)$/sD

The performance improvement here is minor, and Gujarati, Church Slavic,
Udmurt, and Ukrainian would still need the other style for their current
implementations.

For Gujarati, we also use another regex trick: a look-behind assertion
in PCRE must be fixed length, so something like (?<!a|bb) won't work.
But that regex fragment is equivalent to (?<!a)(?<!bb) which is allowed,
so we use that instead.

Bug: 52865
Change-Id: Iaa7eaa446b3f045a9ce970affcb2a889f44bdefd
2013-10-24 09:44:33 +00:00
addshore
de7af7ac2c Fix scope on all /phpunit test methods
Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af
2013-10-24 10:31:32 +02:00
addshore
c40786cba2 Cleanup tests/includes/media
- Adds @covers tags
- fixes comments
- fixes scope
- adds @todos
- split files per class

Change-Id: Id5aaa20769725a96f22fb838d376697c250874a5
2013-10-24 08:12:42 +00:00
jenkins-bot
a6e2f28b2e Merge "mediawiki.inspect: use $.toJSON & add workaround for FF oddity" 2013-10-24 00:53:48 +00:00
Ori Livneh
348de7a7b8 mediawiki.inspect: use $.toJSON & add workaround for FF oddity
* Use $.toJSON rather than JSON.stringify. Make mediawiki.inspect depend on
  jquery.json.
* Firefox doesn't define a console.table, but doesn't throw an exception either
  if you attempt to invoke it. Use Function.prototype#call to call Firefox's
  bluff.

Change-Id: Ib45487d10488f08a98d9635ab9a2a9212e9ef69f
2013-10-23 17:37:21 -07:00
jenkins-bot
ceb4e174f7 Merge "New hook accommodates non-revision rc queries" 2013-10-23 23:44:42 +00:00
Erik Bernhardson
9efb7a7339 New hook accommodates non-revision rc queries
Within Special:RecentChanges the default non-extended query contains

    ( rc_this_oldid=page_latest OR rc_type=3 )

Wikidata has previously used the SpecialWatchlistQuery hook to look for
this exact string and change rc_type=3 to rc_type IN (3,5).  Flow is another
type of change that doesn't have a matching row in revisions to match
page_latest for and needs to be added to this query.

This patch adds a new hook, SpecialWatchlistGetNonRevisionTypes, which allows
different extensions to add to a list of values for rc_type (or rc_source once
85787 is merged).  This will allow multiple extensions to affect the resulting
query without them breaking eachother.

Change-Id: Id6916fe999c0faa38de878b7b5687e7ea00901bd
2013-10-24 10:38:54 +11:00
Brad Jorsch
6e4a46c315 Add $wgSemiprotectedRestrictionLevels
It's possible that a wiki could introduce new protection levels that
should be considered "semiprotected". For example, if an
"emailconfirmed" protection level were added and an appropriate entry
were made in $wgAutopromote, that might be considered semi-protection
since anyone can automatically gain the ability to edit those pages
merely by setting and confirming their email address.

The most straightforward way to take care of this is to add a config
variable to specify which protection levels are considered
"semiprotected". So let's do that.

Also, let's take the opportunity to make
$title->isSemiProtected( 'create' ) works correctly.

Bug: 43462
Change-Id: Ic9db6ff6cbd84bd9734be09efbea5a5891197fa0
2013-10-23 23:19:25 +00:00
Translation updater bot
cd6bc6116b Localisation updates from http://translatewiki.net.
Change-Id: I0073d11e39dd5a11d7c8c44b80401ad7b8fd6313
2013-10-23 18:58:35 +00:00
jenkins-bot
26aac7550a Merge "mediawiki.util: Use 'wikipage.content' hook for TOC hiding" 2013-10-23 18:46:02 +00:00
jenkins-bot
c1becbb85d Merge "Remove all instances of the word "iff"" 2013-10-23 18:16:48 +00:00
Tim Starling
d1bc243f65 Remove all instances of the word "iff"
It's elitist mathematical jargon. In all cases dealt with here, it adds
no additional meaning compared to "if", beyond what was already obvious
from context. Thus, its only purpose is to smugly demonstrate that the
author attended their second-year mathematics classes, at the expense of
causing confusion for everyone who doesn't have such a background.

If you really think you need to convey extra information beyond what
"if" gives you, the English language contains plenty of devices for doing
so, without resorting to neologisms.

Change-Id: Iae21095d02ec2935c10e94f532235c2671c115b1
2013-10-23 10:56:54 -07:00
jenkins-bot
c24ac2c87d Merge "Fix doc error in new incr test" 2013-10-23 17:01:14 +00:00
Matthew Flaschen
613c451286 Fix doc error in new incr test
It covers all implementations of the abstract class method BagOStuff::incr.

Change-Id: I763985477b8564857a0905019c4485dd36f84539
2013-10-23 16:56:05 +00:00
jenkins-bot
708528039d Merge "tablesorter: Unbreak abbreviated month name support" 2013-10-23 15:54:16 +00:00
Siebrand Mazeland
bb0044f638 Address PHP CodeSniffer errors and warnings
One class of errors left unaddressed: Class name "WebInstaller_Language"
is not in camel caps format. I think this can be changed, too, but I
wasn't able to quickly find out where class names are being created.

Change-Id: I920b0231db1b70b68c6c8907257c288a0e112668
2013-10-23 12:42:07 +00:00
addshore
17c1e91238 General cleanup of Parser tests
- Fixes scope
 - Adds covers tags

Change-Id: I6024f2f7cc7a1812a417c6c389b0a15addde0b5e
2013-10-23 12:26:15 +00:00
Bartosz Dziewoński
7342f749da tablesorter: Unbreak abbreviated month name support
Regression from If758499f. Trailing dot was being removed
for genitive forms instead of abbreviated forms.

Bug: 56038
Change-Id: I353da785ff4a1203ae54a981c3c946f9df452902
2013-10-23 11:59:40 +02:00
addshore
5bf45af50e Cleanup MagicVariableTest
- Give methods scope
 - Make providers static
 - Add @covers todo
 - Merge the Providers file that is only used in here

Change-Id: I60a6bbd5a8ad3d9d414de493ec2b083f52114a7b
2013-10-23 07:58:14 +00:00
jenkins-bot
fedbf95f47 Merge "mw.api.postWithToken now forwards promise on fail if we have token" 2013-10-23 07:11:21 +00:00
Kevin Israel
940fb88ba4 Parser::replaceInternalLinks: fix batching
The parser unnecessarily made individual checks for existence of
pages that were neither in LinkCache nor linked only with a fragment.
A Title::isKnown() call in Parser::replaceInternalLinks2() (added in
bca8b8ad7d) caused this.

Title::isKnown() was used to avoid treating a link to a distinct page
as a self-link even when the title happened to match one of the variants
returned by Language::autoConvertToAllVariants(). This change fixes
the bug by moving the problematic portion of the self-link check into
LinkHolderArray::doVariants().

Change-Id: I586e11e8b47308980ea04087ebc4246c397a8f53
2013-10-23 05:48:24 +00:00
Brad Jorsch
33c5d1dbcf Use restriction-level-* messages in Linker::formatTemplates
The current implementation of Linker::formatTemplates only checks for
"sysop" and "autoconfirmed", and completely ignores any other protection
levels. That needs fixing.

Rather than introducing additional messages "template-protected-*" to
match template-protected and template-semiprotected, let's just use the
existing restriction-level-foo messages and wrap them in parentheses.

The old messages are kept for backwards compatability, but could
probably be considered deprecated.

Bug: 43462
Change-Id: I0c507f4ecc1921f599acbda834fa55e96388fa7b
2013-10-23 03:21:57 +00:00
Tim Starling
e6b1baf240 Avoid master queries in Revision::newFromTitle(..., Revision::READ_NORMAL)
The fallback to master makes sense in Revision::newFromId(), since a
revision ID known to exist by some other means might be present in the
master but not in the slave. But it doesn't make sense for
Revision::newFromTitle(), where by far the most common cause of this
case being hit is the page being nonexistent.

Change-Id: I41189fcde1b8065ac134982241376d63b78732a1
2013-10-23 00:22:50 +00:00
jenkins-bot
02cad7573e Merge "Fix Redis increment behavior by using BagOStuff->incr instead" 2013-10-22 23:49:01 +00:00
jenkins-bot
5f5a114412 Merge "Test BagOStuff->incr method" 2013-10-22 23:47:25 +00:00
Matthew Flaschen
face4812c6 Fix Redis increment behavior by using BagOStuff->incr instead
Due to the PHP serialization, the Redis native INCR and INCRBY do not
work.  This instead falls back on the parent class's incr, which uses
lock and unlock, and incrementing on the PHP side.

Bug: 55986
Change-Id: I500199aeb935963ca118fde163bd7ba0cba8f79f
2013-10-22 17:39:00 -04:00
Matthew Flaschen
7cff82a118 Test BagOStuff->incr method
Change-Id: I3b72f19df82ee302dee47dcf22b69ed9bb6ff8e0
2013-10-22 15:48:50 -04:00
Fomafix
d94d206511 mediawiki.util: Use 'wikipage.content' hook for TOC hiding
Bug: 54437
Change-Id: I82f441111bf3d6018b569dc728a3c152b721db7d
2013-10-22 19:43:23 +00:00
Aaron Schulz
25d1af122d lockmanager: QuorumLockManager subclasses can get EX/SH locks at once
* Also reduced rount trips in doUnlockingRequestBucket().
* Also removed some redundant doc comments.

Change-Id: I81878e92332509bd7fda9ddeef950b774f5b015d
2013-10-22 17:18:07 +00:00
addshore
46a17d0fc3 Cleanup /languages/* tests
This change:
 - Adds method scope
 - adds @covers tags
 - adds various @todos
 - fixes some comments

Before the changes tests ran with:
   1383 tests, 1412 assertions 10 skips
After changes the results remain the same

Change-Id: Iee57447bdb47026952ef5dcce6fed5dad0f80e52
2013-10-22 12:32:29 +02:00
Niklas Laxström
af628c5141 mw.api.postWithToken now forwards promise on fail if we have token
Without this fix the callers of this function could not read the
failure code and result, because we returned undefined. Because
we are using a filter function, we need to explicitly return the
promise to pass it forward.

Change-Id: I71984ac827618459f723b0b9f47d4dc29e2a2f70
2013-10-22 09:50:05 +00:00
addshore
fb16eb2abe Add more @covers tags and test cleanup
Other cleanup includes
 - Adding method scopes
 - Fixing php comments
 - Adding todos

Change-Id: I0a231008e6a59110ffcab6af1bd8c4d3ee13f21d
2013-10-22 08:59:42 +00:00
Mwalker
98ca3186ec Merge "Mention the new HTMLForm 'vform' display format." 2013-10-22 02:34:45 +00:00
jenkins-bot
99362c6add Merge "Fixes for duplicateStderr (I833aeb3a)" 2013-10-22 02:34:27 +00:00
S Page
31c479de3c Mention the new HTMLForm 'vform' display format.
Change Id03d185bbee990595bfc469a61163cc598fc3441 added the feature.

Change-Id: I17ccb127e47047dc32f930ce1775496ea22410d2
2013-10-21 19:27:14 -07:00
Translation updater bot
d987f43b24 Localisation updates from http://translatewiki.net.
Change-Id: I0539a27c72b9a270db4e3b29a4c357e40d806353
2013-10-21 22:51:33 +00:00
jenkins-bot
f84bc1e17e Merge "mediawiki.inspect: add CSS report" 2013-10-21 20:35:36 +00:00
jenkins-bot
91f5f17708 Merge "Added a few more trx sanity checks to DatabaseBase" 2013-10-21 20:28:44 +00:00
jenkins-bot
b936da165f Merge "Have list items occupy their own line" 2013-10-21 20:24:22 +00:00
Translation updater bot
a78bddbee1 Localisation updates from http://translatewiki.net.
Change-Id: I922e660fafc7a952129beebeaed001712f5c2bc1
2013-10-21 19:42:49 +00:00
jenkins-bot
8c5733c449 Merge "Clean up old title on move before reset article id" 2013-10-21 17:45:26 +00:00
jenkins-bot
2696339201 Merge "jquery.localize: Fix incorrect use of void tag for <html:msg>" 2013-10-21 17:43:37 +00:00
jenkins-bot
3f28abadc2 Merge "Fix typo erronously -> erroneously" 2013-10-21 17:39:13 +00:00
jenkins-bot
733dc17716 Merge "Add 'RedisPubSubFeedEngine' feed engine" 2013-10-21 17:37:36 +00:00
Timo Tijhof
a8ed966ee4 Fix typo erronously -> erroneously
Follows-up 1aed5382d2.

Change-Id: I1e0cbc3dfa529816446c3aec6372eb2b821ee540
2013-10-21 19:29:16 +02:00
Timo Tijhof
0bd19ecfc7 jquery.localize: Fix incorrect use of void tag for <html:msg>
Follows-up 55dac1f which errounously changed a few <html:msg />
to <html:msg> while trying to fix up <span/></span>.

Bug: 40598
Change-Id: I987fa288cc1b97a8a5fb367aae2626d7d0b48238
2013-10-21 19:27:07 +02:00