Commit graph

229 commits

Author SHA1 Message Date
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
Liangent
2fff677ca9 Disable template expansion in message <autoblocker>.
Sometimes sysops put template calls in block messages and they will be
expanded in the <blockedtext> interface. However in corresponding
autoblocks, template calls get expanded to long strings and truncated.

Change-Id: I3150192ec8c95d2e4807f058a855856e467145de
2013-01-18 11:07:36 +00:00
Aaron Schulz
8feda3a26f Made Block::purgeExpired() check for read-only mode.
Change-Id: Ida4f82b8e17a0f7ba872e46fd8a4c87831e5254f
2013-01-17 14:25:55 -08:00
Aaron Schulz
e478e48810 Merge "Make Block::newFromTarget() work again when passing only a vague target" 2013-01-11 23:39:17 +00:00
Alexandre Emsenhuber
323480faaa Make Block::newFromTarget() work again when passing only a vague target
Since SVN r106354 (85ee2d2d), when passing null or an invalid block target
to Block::newFromTarget(), it was never returning any block, even if the
vague target would have matched one.

This broke two features of core MediaWiki:
- Excluding user and user talk pages of blocked users from being indexed,
  the feature that actually caused bug 33101 and the revision mentionned above
- Blocking of account creation when both the user and its IP address are blocked,
  but of only the IP address blocks prevents account creation (bug 13611)
And maybe some others in extensions, I didn't check that.

This changes reverts part of r106354 to make Block::newFromTarget() work again
in that case and changed Article::getRobotPolicy() to pass the user to be checked
as vague target only when it's an IP address and as specific target otherwise.

Change-Id: Ie7e16e0bae8c4326d16cca237877693f7b474a01
2013-01-11 11:30:21 +01:00
Alexandre Emsenhuber
d85239a186 Use ResultWrapper::numRows() instead of DatabaseBase::numRows()
Change-Id: I87f059aaff72bf06ebc72ad3a7904cca8e11fab9
2013-01-06 11:52:40 +01:00
umherirrender
8b948fc6e6 recentchanges.rc_ip is used for retroactive autoblocks
Document this at $wgPutIPinRC and check the global explicit

Change-Id: I5a796edc855ae954ebd0fb11fe54b486e5eff7ed
2013-01-04 20:58:00 +01:00
Alexandre Emsenhuber
d4716689d1 Block::parseTarget() accepts and can return null
Documentation currently omits this.

Change-Id: I183121e5134c1bbd53a613780d171b52737f071d
2013-01-03 11:53:41 +01:00
Antoine Musso
cb60d72be1 misc style fix
* makes booleans lower case
* add spaces before open braces

Change-Id: Id88884e08bc23d7730361ee91646f54f5e16920b
2012-12-20 16:09:25 +01:00
umherirrender
82375631c2 Fix tabs inside/between statements/text
This tabs are strange and a space there is better

Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
2012-10-26 18:18:59 +02:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Siebrand Mazeland
475a1daa03 Replace some occurrences of wfMsg* by alternatives. Undeprecated wfMsgReplaceArgs.
* wfMsgReplaceArgs isn't really i18n related. It just replaces text parts.
* Updated language.txt. Now refers to mediawiki.org.
* Removed deprecated Block::formatExpiry(). Merge Id7d057a4 first.
* Reformatted weirdly formatted array in ApiBase.php.
* Removed wfMsg() in RandomTest.php.

Change-Id: Ied5cfda8fa5d9283dfeebdcb0e1af8453d47e7a9
2012-09-03 11:49:58 +02:00
Alex Monk
2fabea7eea Use wfMessage instead of deprecated wfMsg*
Or $this->msg in special pages.

Change-Id: I774a89d646615053c8424050e42ad95601f92543
2012-08-18 14:11:05 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Antoine Musso
281510195d remove windows lines ending
Introduced by commit 6c2cf98
https://gerrit.wikimedia.org/r/8919

Change-Id: Idfe6dd1f6d2b7fabfdbccd9acf6f0dcbbb5833be
2012-05-27 21:40:19 +02:00
umherirrender
6c2cf98e3d Block.php: replace '*' with explicit fields in selects
It is good practice to select only fields, which are used later

Change-Id: I50d149b3ecd3a9e0325fecbe8d0b6e1fff353893
2012-05-25 16:50:57 +02:00
Demon
b095e93a1a Merge "Use the same object when checking if the user is blocked instead of creating a new one." 2012-05-04 14:09:05 +00:00
Marc A. Pelletier
7694faf68f (bug 5445) remove autoblocks when user is unblocked
Previously, whenever we blocked a user, its IP address would be
autoblocked whenever he tries to edit a page. Thus when later unblocking
the username, he would be automatically blocked again if we forgot to
clean up is IP.

This patch introduces a the ipb_parent_block_id column in ipblocks table
to track which block triggered the autoblock command. Thus, when deleting
the original block we can easily remove all subsequentautoblocks.

Schema updaters for MySQL, SQLite and postgres have been added to the
patch but not for the other database types such as ibm_db2, mssql and
Oracle.

Change-Id: I4aa820ae9bbd962a12d0b48b6c638a1b6ff4efc9
2012-05-03 12:07:30 +02:00
Alexandre Emsenhuber
89df167b20 Use the same object when checking if the user is blocked instead of creating a new one.
* Block::parseTarget() first called trim() on its parameter which was converting objects into string, thus making the checks for object and null useless; now trim() is called after these checks.
* User::getBlockedStatus() was passing $this->getName() to Block::newFromTargert() which in turn was passed to Block::parseTarget() where a new User object was created.
  Instead of this, the User object is directly passed to Block::newFromTargert(), which avoids creating a new object for the same user.

Change-Id: Iffea21d4f53e8692072749264f7486c22b6be5fd
2012-04-17 09:48:58 +02:00
Aaron Schulz
e82c2cc7ee Merged r114672 from wmf1.19 plus tests; crosswiki block name/id fix.
Change 1:
* Delete any pre-existing block for the tests
* Renamed test function and fixed comment typo

Change-Id: I4804ccae81dd0455e9d3ddf48960c4b5cd6e4f5f
2012-04-10 09:49:52 -07:00
Aaron Schulz
7377efa7de Force the target user ID to be the correct foreign ID on the relevant local wikis for crosswiki suppress blocks. 2012-02-28 02:04:30 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Sam Reed
85ee2d2db2 * (bug 33101) Viewing a User or User talk of username resembling IP ending with .xxx causes Internal error
Patch by Brad Jorsch

Also simplify double return null in method
2011-12-15 18:57:53 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Sam Reed
ec9afed7ce Add a getExpiry method to Block (rather than direct member variable access. Yuck) 2011-12-06 15:23:21 +00:00
Jure Kajzer
69e66bdfe9 * reverted changes to Block and ApiBlockTest made in r102625 ... PEBKAC 2011-11-10 09:36:18 +00:00
Jure Kajzer
be3bbfc539 * Added getInfinity to DatabaseOracle
* Block - replaced 'infinity' strings with DB->getInfinity calls
* UploadStash - added sequence value generation for ID
2011-11-10 07:41:12 +00:00
Jure Kajzer
d9b00fc155 * fixed ipblocks.ipb_by_text field, removed default blank not null (fixed install&update)
* fixed Block->insert; ipblocks.ipb_id is autoincrement field (should use sequences for compatibility)
2011-11-04 11:35:10 +00:00
Aaron Schulz
7916d730ae (bug 31739) Made Block code support ipb_by = 0 convention with for foreign users again, as it did pre 1.18. The byText param has been restored in the Block() constructor as CentralAuth still uses it. Some callers have been updated to reflect the fact that getBlocker() may be a local User or a string username.
Ideally, we might have a ForeignUser class and a generic User interface...but this will do for now.
2011-11-01 00:11:53 +00:00
Sam Reed
9d41b95053 Kill various unused variables
Comment some out also

Add some bits of documentation
2011-10-29 01:17:26 +00:00
Sam Reed
27665d27ae Update some deprecated code
Documentation

Fix "/*" comments to "/**"

Flesh out some missing returns, change some return types
2011-10-14 21:18:38 +00:00
Robin Pepermans
894bdaabe4 Fix r91886 thanks to johnduhart: check if it is an IP *before* stripping subpages, otherwise IP range blocking does not work 2011-08-12 14:32:05 +00:00
Rotem Liss
1d2e8d29ef Fixing comment (no Language::decodeExpiry). 2011-08-02 11:47:36 +00:00
Sam Reed
fcebee405f Add comment
Remove unused wfGetDb()
2011-07-18 22:23:42 +00:00
Andrew Garrett
4b12070e70 Fix autoblocks in r92480 r92482 -- modified the wrong half 2011-07-18 22:02:11 +00:00
Andrew Garrett
db9832ae98 Fix autoblocks in r92480 2011-07-18 21:56:59 +00:00
Andrew Garrett
365bf2cfc3 Block.php fixes: Always store mExpiry as a TS_MW or "infinity". Convert as appropriate. 2011-07-18 21:48:56 +00:00
Aaron Schulz
4a1b848c58 Follow-up r92220: changed autoblock handling to use PerformRetroactiveAutoblock hook instead of a global. Also made CheckUser always override autoblocks (no config). 2011-07-15 00:48:02 +00:00
Aaron Schulz
02af8ad230 * Removed angry autoblock code - unused by anything
* Added $wgAutoblockHandlers variable for alternative autoblock handling functions
* Gave CheckUser a potential $wgAutoblockHandlers function (bug 29330)
2011-07-15 00:05:50 +00:00
Robin Pepermans
740b9aa49f (bug 29797) Error: "Tried to load block with invalid type" when subpages are disabled for user pages.
Patch by Jarry1250
2011-07-11 16:53:31 +00:00
Happy-melon
b99ab08b2a Follow-up r88738: this check is no longer needed since r88750. 2011-06-27 13:48:01 +00:00
Happy-melon
89b9bc984d Follow-up r84588 CR 2011-06-26 23:10:57 +00:00
Happy-melon
f26f0a13ae Follow-up r84475 CR; and also documentation fixes; PhpStorm 2.1 is *even more* fussy about documentation format... :D 2011-06-26 23:01:29 +00:00
Siebrand Mazeland
7779b72373 Reduce calls to wfTimestampNow() by using temporary variable. Inspired by CR on r88278. 2011-06-24 10:00:35 +00:00
Aaron Schulz
66894363d8 Tweaked comments and code in confusing spot of doAutoblock() 2011-06-18 00:29:32 +00:00
Brion Vibber
6286ac2971 Another partial fix for Block test: update $this->mId on successful Block::insert() 2011-06-15 20:42:16 +00:00
Brion Vibber
39259a36ec Fix for partial regression in r84534: Block::newFromId was no longer handling the case where there was no matching row correctly. Now returns null.
This bug was showing up in test results like this:

  BlockTest::testInitializerFunctionsReturnCorrectBlock
  Trying to get property of non-object
  
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:340
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:365
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:118
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/BlockTest.php:60
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

However, that only triggers because the actual test is failing -- it's expecting to get a return back. This can only be reproduce when using the suite.xml configuration file, and not when running the BlockTest standalone.
2011-06-15 19:05:25 +00:00