Page MenuHomePhorge

No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None
diff --git a/includes/specials/pagers/BlockListPager.php b/includes/specials/pagers/BlockListPager.php
index 111f4880893..f44df02b4fb 100644
--- a/includes/specials/pagers/BlockListPager.php
+++ b/includes/specials/pagers/BlockListPager.php
@@ -527,6 +527,7 @@ class BlockListPager extends TablePager {
'block_target.bt_user',
HideUserUtils::SHOWN_USERS
);
+ $info['conds']['bl_deleted'] = 0;
}
return $info;
}
diff --git a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php
index 5f394c5f572..f9dbc77e57b 100644
--- a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php
+++ b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php
@@ -393,6 +393,17 @@ class BlockListPagerTest extends MediaWikiIntegrationTestCase {
$this->assertStringNotContainsString( $addr, $body );
}
+ /**
+ * @param string $expected
+ * @param string $actual
+ */
+ private function assertStringNotContainsStringIgnoringPunctuation( $expected, $actual ) {
+ $this->assertStringNotContainsString( $expected, $actual );
+ // Fail even if punctuation in the name was replaced
+ $regex = '/' . preg_replace( '/[^A-Za-z0-9]+/', '.+', $expected ) . '/';
+ $this->assertDoesNotMatchRegularExpression( $regex, $actual );
+ }
+
/**
* T391343 regression test
* @coversNothing
@@ -419,9 +430,26 @@ class BlockListPagerTest extends MediaWikiIntegrationTestCase {
$pager = $this->getBlockListPager();
$body = $pager->getBody();
- $this->assertStringNotContainsString( $user->getName(), $body );
- // Fail even if punctuation in the name was replaced
- $regex = '/' . preg_replace( '/[^A-Za-z0-9]+/', '.+', $user->getName() ) . '/';
- $this->assertDoesNotMatchRegularExpression( $regex, $body );
+ $this->assertStringNotContainsStringIgnoringPunctuation( $user->getName(), $body );
+ }
+
+ /**
+ * T397595 regression test
+ * @coversNothing
+ */
+ public function testAutoblockSuppression() {
+ $user = $this->getTestUser()->getUserIdentity();
+ $store = $this->getServiceContainer()->getDatabaseBlockStore();
+ $block = $store->insertBlockWithParams( [
+ 'targetUser' => $user,
+ 'by' => $this->getTestSysop()->getUser(),
+ 'hideName' => true,
+ 'enableAutoblock' => true,
+ ] );
+ $store->doAutoblock( $block, '127.0.0.42' );
+
+ $pager = $this->getBlockListPager();
+ $body = $pager->getBody();
+ $this->assertStringNotContainsStringIgnoringPunctuation( $user->getName(), $body );
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:33 AM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227869
Default Alt Text
(2 KB)

Event Timeline