* @return array
*/
public function getBlockErrorParams( IContextSource $context ) {
+ $lang = $context->getLanguage();
+
$blocker = $this->getBlocker();
if ( $blocker instanceof User ) { // local user
$blockerUserpage = $blocker->getUserPage();
- $link = "[[{$blockerUserpage->getPrefixedText()}|{$blockerUserpage->getText()}]]";
+ $blockerText = $lang->embedBidi( $blockerUserpage->getText() );
+ $link = "[[{$blockerUserpage->getPrefixedText()}|{$blockerText}]]";
} else { // foreign user
$link = $blocker;
}
/* $ip returns who *is* being blocked, $intended contains who was meant to be blocked.
* This could be a username, an IP range, or a single IP. */
- $intended = $this->getTarget();
- $lang = $context->getLanguage();
+ $intended = (string)$this->getTarget();
return [
$link,
$reason,
$context->getRequest()->getIP(),
- $this->getByName(),
+ $lang->embedBidi( $this->getByName() ),
// TODO: SystemBlock replaces this with the system block type. Clean up
// error params so that this is not necessary.
$this->getId(),
$lang->formatExpiry( $this->getExpiry() ),
- (string)$intended,
+ $lang->embedBidi( $intended ),
$lang->userTimeAndDate( $this->getTimestamp(), $context->getUser() ),
];
}
] );
$this->user->mBlock->mTimestamp = 0;
$this->assertEquals( [ [ 'autoblockedtext',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', null, 'infinite', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", null, 'infinite', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $prev ), true ) ] ],
MediaWikiServices::getInstance()->getPermissionManager()->getPermissionErrors(
'move-target', $this->user, $this->title ) );
'expiry' => 10,
] );
$this->assertEquals( [ [ 'blockedtext',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', null, '23:00, 31 December 1969', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", null, '23:00, 31 December 1969', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ],
MediaWikiServices::getInstance()->getPermissionManager()
->getPermissionErrors( 'move-target', $this->user, $this->title ) );
] );
$errors = [ [ 'systemblockedtext',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', 'test', 'infinite', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", 'test', 'infinite', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ];
$this->assertEquals( $errors,
] );
$errors = [ [ 'blockedtext-partial',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', null, '23:00, 31 December 1969', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", null, '23:00, 31 December 1969', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ];
$this->assertEquals( $errors,
] );
$errors = [ [ 'blockedtext',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', null, 'infinite', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", null, 'infinite', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ];
$this->assertEquals( $errors,
] );
$this->user->mBlock->setTimestamp( 0 );
$this->assertEquals( [ [ 'autoblockedtext',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', null, 'infinite', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", null, 'infinite', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $prev ), true ) ] ],
$this->title->getUserPermissionsErrors( 'move-target',
$this->user ) );
'expiry' => 10,
] );
$this->assertEquals( [ [ 'blockedtext',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', null, '23:00, 31 December 1969', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", null, '23:00, 31 December 1969', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ],
$this->title->getUserPermissionsErrors( 'move-target', $this->user ) );
# $action != 'read' && $action != 'createaccount' && $user->isBlockedFrom( $this )
] );
$errors = [ [ 'systemblockedtext',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', 'test', 'infinite', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", 'test', 'infinite', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ];
$this->assertEquals( $errors,
] );
$errors = [ [ 'blockedtext-partial',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', null, '23:00, 31 December 1969', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", null, '23:00, 31 December 1969', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ];
$this->assertEquals( $errors,
] );
$errors = [ [ 'blockedtext',
- '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', null, 'infinite', '127.0.8.1',
+ "[[User:Useruser|\u{202A}Useruser\u{202C}]]", 'no reason given', '127.0.0.1',
+ "\u{202A}Useruser\u{202C}", null, 'infinite', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ];
$this->assertEquals( $errors,