http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89087
Revision: 89087
Author: hashar
Date: 2011-05-29 07:00:52 +0000 (Sun, 29 May 2011)
Log Message:
-----------
PreviousTarget is now optional when blocking a user
The API does not seem to give a PreviousTarget field all the time.
This patch also fix the an assertion for ApiBlockTest::testMakeNormalBlock
Modified Paths:
--------------
trunk/phase3/includes/specials/SpecialBlock.php
Modified: trunk/phase3/includes/specials/SpecialBlock.php
===================================================================
--- trunk/phase3/includes/specials/SpecialBlock.php 2011-05-29 04:19:51 UTC
(rev 89086)
+++ trunk/phase3/includes/specials/SpecialBlock.php 2011-05-29 07:00:52 UTC
(rev 89087)
@@ -633,7 +633,7 @@
$status = $block->insert();
if( !$status ) {
# Show form unless the user is already aware of this...
- if( ( $data['PreviousTarget'] != htmlspecialchars(
$block->getTarget() ) ) || !$data['Confirm'] ) {
+ if( ( array_key_exists('PreviousTarget', $data ) &&
$data['PreviousTarget'] != htmlspecialchars( $block->getTarget() ) ) ||
!$data['Confirm'] ) {
return array( array( 'ipb_already_blocked',
$block->getTarget() ) );
# Otherwise, try to update the block...
} else {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs