Commit graph

218 commits

Author SHA1 Message Date
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
Chad Horohoe
e1d01b4d7b Fix (Api)BlockTest for Sqlite. getRangeStart()/getRangeEnd() were returning null for user blocks, which was then happily inserted into a NOT NULL column. The IGNORE was just masking the real error. Thanks Brion and MaxSem. Oh, and ping r84475 2011-06-07 18:13:21 +00:00
Mark A. Hershberger
a6722cc9aa w/s changes. 2011-06-02 19:32:45 +00:00
Sam Reed
4065e65d03 Even more documentation in various files 2011-05-29 14:24:27 +00:00
Sam Reed
2b676156ba And even more documentation 2011-05-28 18:58:51 +00:00
Brion Vibber
536fad8f90 * (bug 29116) Fix regression breaking CheckUser extension
Fixes regression from r84475 and friends which made Block->load() and its new front-end Block::newFromTarget() fail when an empty string was passed in as the IP / $vagueTarget parameter to indicate skipping IP-based lookups.
Added phpunit test cases to confirm that both Block->load() and Block::newFromTarget() work when given null (already ok), '' (as done from CheckUser), or false (not seen, but perfectly legit sounding).
Adjusted comparisons to work as expected.
2011-05-24 21:04:50 +00:00
Happy-melon
28105675da (bug 29116) follow-up r84475: normalise the empty string to null in Block::newFromTarget(). 2011-05-24 19:03:41 +00:00
Happy-melon
d91b0ed998 Follow-up r84475: Block::parseTarget() should always return an array. 2011-05-23 18:52:36 +00:00
Alexandre Emsenhuber
9536c97c00 DB_READ -> DB_SLAVE, the former is obsolete 2011-05-18 19:29:50 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Sam Reed
1d5b18a1a2 Revert r85776, r85782 pending better solution 2011-04-12 20:27:26 +00:00
Sam Reed
89a136bb46 Followup r85776, per Aaron, add documentation showing reason why explicit creation of a new LB was added 2011-04-11 12:48:59 +00:00