* The MWNamespace class is deprecated. Use MediaWikiServices::getNamespaceInfo.
* ExtensionRegistry->load() is deprecated, as it breaks dependency checking.
Instead, use ->queue().
+* User::isBlocked() is deprecated since it does not tell you if the user is
+ blocked from editing a particular page. Use User::getBlock() or
+ PermissionManager::isBlockedFrom() or PermissionManager::userCan() instead.
* …
=== Other changes in 1.34 ===
case APCOND_IPINRANGE:
return IP::isInRange( $user->getRequest()->getIP(), $cond[1] );
case APCOND_BLOCKED:
- return $user->isBlocked();
+ // @TODO Should partial blocks prevent auto promote?
+ return (bool)$user->getBlock();
case APCOND_ISBOT:
return in_array( 'bot', User::getGroupPermissions( $user->getGroups() ) );
default:
$this->requireOnlyOneParameter( $params, 'user', 'userid' );
# T17810: blocked admins should have limited access here
- if ( $user->isBlocked() ) {
+ $block = $user->getBlock();
+ if ( $block ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
$this->dieWithError(
$status,
null,
- [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) ]
+ [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $block ) ]
);
}
}
$vals['anon'] = true;
}
- if ( isset( $this->prop['blockinfo'] ) && $user->isBlocked() ) {
- $vals = array_merge( $vals, self::getBlockInfo( $user->getBlock() ) );
+ if ( isset( $this->prop['blockinfo'] ) ) {
+ $block = $user->getBlock();
+ if ( $block ) {
+ $vals = array_merge( $vals, self::getBlockInfo( $block ) );
+ }
}
if ( isset( $this->prop['hasmsg'] ) ) {
$user = $this->getUser();
$this->checkUserRightsAny( RevisionDeleter::getRestriction( $params['type'] ) );
- if ( $user->isBlocked() ) {
- $this->dieBlocked( $user->getBlock() );
+ // @TODO Use PermissionManager::isBlockedFrom() instead.
+ $block = $user->getBlock();
+ if ( $block ) {
+ $this->dieBlocked( $block );
}
if ( !$params['ids'] ) {
// make sure the user is allowed
$this->checkUserRightsAny( 'changetags' );
- if ( $user->isBlocked() ) {
- $this->dieBlocked( $user->getBlock() );
+ // @TODO Use PermissionManager::isBlockedFrom() instead.
+ $block = $user->getBlock();
+ if ( $block ) {
+ $this->dieBlocked( $block );
}
// Check if user can add tags
$this->dieWithError( 'apierror-permissiondenied-unblock', 'permissiondenied' );
}
# T17810: blocked admins should have limited access here
- if ( $user->isBlocked() ) {
+ $block = $user->getBlock();
+ if ( $block ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
$this->dieWithError(
$status,
null,
- [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) ]
+ [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $block ) ]
);
}
}
// Deny if the user is blocked and doesn't have the full 'userrights' permission.
// This matches what Special:UserRights does for the web UI.
- if ( $pUser->isBlocked() && !$pUser->isAllowed( 'userrights' ) ) {
- $this->dieBlocked( $pUser->getBlock() );
+ if ( !$pUser->isAllowed( 'userrights' ) ) {
+ // @TODO Should the user be blocked from changing user rights if they
+ // are partially blocked?
+ $block = $pUser->getBlock();
+ if ( $block ) {
+ $this->dieBlocked( $block );
+ }
}
$params = $this->extractRequestParams();
"apihelp-edit-param-text": "Page content.",
"apihelp-edit-param-summary": "Edit summary. Also section title when $1section=new and $1sectiontitle is not set.",
"apihelp-edit-param-tags": "Change tags to apply to the revision.",
- "apihelp-edit-param-minor": "Minor edit.",
- "apihelp-edit-param-notminor": "Non-minor edit.",
+ "apihelp-edit-param-minor": "Mark this edit as a minor edit.",
+ "apihelp-edit-param-notminor": "Do not mark this edit as a minor edit even if the \"{{int:tog-minordefault}}\" user preference is set.",
"apihelp-edit-param-bot": "Mark this edit as a bot edit.",
"apihelp-edit-param-basetimestamp": "Timestamp of the base revision, used to detect edit conflicts. May be obtained through [[Special:ApiHelp/query+revisions|action=query&prop=revisions&rvprop=timestamp]].",
"apihelp-edit-param-starttimestamp": "Timestamp when the editing process began, used to detect edit conflicts. An appropriate value may be obtained using <var>[[Special:ApiHelp/main|curtimestamp]]</var> when beginning the edit process (e.g. when loading the page content to edit).",
}
public function beginSecondaryAuthentication( $user, array $reqs ) {
+ // @TODO Partial blocks should not prevent the user from logging in.
+ // see: https://phabricator.wikimedia.org/T208895
if ( !$this->blockDisablesLogin ) {
return AuthenticationResponse::newAbstain();
- } elseif ( $user->isBlocked() ) {
+ } elseif ( $user->getBlock() ) {
return AuthenticationResponse::newFail(
new \Message( 'login-userblocked', [ $user->getName() ] )
);
if ( !is_null( $user ) ) {
if ( !$user->isAllowed( 'applychangetags' ) ) {
return Status::newFatal( 'tags-apply-no-permission' );
- } elseif ( $user->isBlocked() ) {
+ } elseif ( $user->getBlock() ) {
+ // @TODO Ensure that the block does not apply to the `applychangetags`
+ // right.
return Status::newFatal( 'tags-apply-blocked', $user->getName() );
}
}
if ( !is_null( $user ) ) {
if ( !$user->isAllowed( 'changetags' ) ) {
return Status::newFatal( 'tags-update-no-permission' );
- } elseif ( $user->isBlocked() ) {
+ } elseif ( $user->getBlock() ) {
+ // @TODO Ensure that the block does not apply to the `changetags`
+ // right.
return Status::newFatal( 'tags-update-blocked', $user->getName() );
}
}
if ( !is_null( $user ) ) {
if ( !$user->isAllowed( 'managechangetags' ) ) {
return Status::newFatal( 'tags-manage-no-permission' );
- } elseif ( $user->isBlocked() ) {
+ } elseif ( $user->getBlock() ) {
+ // @TODO Ensure that the block does not apply to the `managechangetags`
+ // right.
return Status::newFatal( 'tags-manage-blocked', $user->getName() );
}
}
if ( !is_null( $user ) ) {
if ( !$user->isAllowed( 'managechangetags' ) ) {
return Status::newFatal( 'tags-manage-no-permission' );
- } elseif ( $user->isBlocked() ) {
+ } elseif ( $user->getBlock() ) {
+ // @TODO Ensure that the block does not apply to the `managechangetags`
+ // right.
return Status::newFatal( 'tags-manage-blocked', $user->getName() );
}
}
if ( !is_null( $user ) ) {
if ( !$user->isAllowed( 'managechangetags' ) ) {
return Status::newFatal( 'tags-manage-no-permission' );
- } elseif ( $user->isBlocked() ) {
+ } elseif ( $user->getBlock() ) {
+ // @TODO Ensure that the block does not apply to the `managechangetags`
+ // right.
return Status::newFatal( 'tags-manage-blocked', $user->getName() );
}
}
if ( !is_null( $user ) ) {
if ( !$user->isAllowed( 'deletechangetags' ) ) {
return Status::newFatal( 'tags-delete-no-permission' );
- } elseif ( $user->isBlocked() ) {
+ } elseif ( $user->getBlock() ) {
+ // @TODO Ensure that the block does not apply to the `deletechangetags`
+ // right.
return Status::newFatal( 'tags-manage-blocked', $user->getName() );
}
}
* @param string $text
* @return Content
*/
- public function toEditContent( $text ) {
+ private function toEditContent( $text ) {
return ContentHandler::makeContent(
$text,
$this->title,
&& $watchingUser->isEmailConfirmed()
&& $watchingUser->getId() != $userTalkId
&& !in_array( $watchingUser->getName(), $wgUsersNotifiedOnAllChanges )
- && !( $wgBlockDisablesLogin && $watchingUser->isBlocked() )
+ // @TODO Partial blocks should not prevent the user from logging in.
+ // see: https://phabricator.wikimedia.org/T208895
+ && !( $wgBlockDisablesLogin && $watchingUser->getBlock() )
&& Hooks::run( 'SendWatchlistEmailNotification', [ $watchingUser, $title, $this ] )
) {
$this->compose( $watchingUser, self::WATCHLIST );
wfDebug( __METHOD__ . ": user talk page edited, but user does not exist\n" );
} elseif ( $targetUser->getId() == $editor->getId() ) {
wfDebug( __METHOD__ . ": user edited their own talk page, no notification sent\n" );
- } elseif ( $wgBlockDisablesLogin && $targetUser->isBlocked() ) {
+ } elseif ( $wgBlockDisablesLogin && $targetUser->getBlock() ) {
+ // @TODO Partial blocks should not prevent the user from logging in.
+ // see: https://phabricator.wikimedia.org/T208895
wfDebug( __METHOD__ . ": talk page owner is blocked and cannot login, no notification sent\n" );
} elseif ( $targetUser->getOption( 'enotifusertalkpages' )
&& ( !$minorEdit || $targetUser->getOption( 'enotifminoredits' ) )
} elseif ( is_string( $target ) ) {
$target = User::newFromName( $target );
}
- if ( $performer->isBlocked() ) {
+ if ( $performer->getBlock() ) {
if ( $target instanceof User && $target->getId() == $performer->getId() ) {
# User is trying to unblock themselves
+ // @TODO Ensure that the block does not apply to the `unblockself`
+ // right.
if ( $performer->isAllowed( 'unblockself' ) ) {
return true;
# User blocked themselves and is now trying to reverse it
if ( ( $id !== null ) || ( $id === null && IP::isIPAddress( $username ) ) ) {
if ( $sp->getUser()->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
- if ( $target->isBlocked() && $target->getBlock()->getType() != Block::TYPE_AUTO ) {
+ if ( $target->getBlock() && $target->getBlock()->getType() != Block::TYPE_AUTO ) {
$tools['block'] = $linkRenderer->makeKnownLink( # Change block link
SpecialPage::getTitleFor( 'Block', $username ),
$sp->msg( 'change-blocklink' )->text()
$request = $this->getRequest();
// Check blocks
- if ( $user->isBlocked() ) {
- throw new UserBlockedError( $user->getBlock() );
+ // @TODO Use PermissionManager::isBlockedFrom() instead.
+ $block = $user->getBlock();
+ if ( $block ) {
+ throw new UserBlockedError( $block );
}
$this->setHeaders();
$user = $this->getUser();
// Check blocks
- if ( $user->isBlocked() ) {
- throw new UserBlockedError( $user->getBlock() );
+ // @TODO Use PermissionManager::isBlockedFrom() instead.
+ $block = $user->getBlock();
+ if ( $block ) {
+ throw new UserBlockedError( $block );
}
$this->setHeaders();
$isself = $this->getUser()->equals( $targetUser );
$available = $this->changeableGroups();
- if ( $targetUser->getId() == 0 ) {
+ if ( $targetUser->getId() === 0 ) {
return false;
}
- return !empty( $available['add'] )
- || !empty( $available['remove'] )
- || ( ( $isself || !$checkIfSelf ) &&
- ( !empty( $available['add-self'] )
- || !empty( $available['remove-self'] ) ) );
+ if ( $available['add'] || $available['remove'] ) {
+ // can change some rights for any user
+ return true;
+ }
+
+ if ( ( $available['add-self'] || $available['remove-self'] )
+ && ( $isself || !$checkIfSelf )
+ ) {
+ // can change some rights for self
+ return true;
+ }
+
+ return false;
}
/**
* (e.g. they don't have the userrights permission), then don't
* allow them to change any user rights.
*/
- if ( $user->isBlocked() && !$user->isAllowed( 'userrights' ) ) {
- throw new UserBlockedError( $user->getBlock() );
+ if ( !$user->isAllowed( 'userrights' ) ) {
+ // @TODO Should the user be blocked from changing user rights if they
+ // are partially blocked?
+ $block = $user->getBlock();
+ if ( $block ) {
+ throw new UserBlockedError( $user->getBlock() );
+ }
}
$this->checkReadOnly();
$user = $session->getUser();
if ( $user->isLoggedIn() ) {
$this->loadFromUserObject( $user );
- if ( $user->isBlocked() ) {
+ if ( $user->getBlock() ) {
// If this user is autoblocked, set a cookie to track the Block. This has to be done on
// every session load, because an autoblocked editor might not edit again from the same
// IP address after being blocked.
/**
* Check if user is blocked
*
+ * @deprecated since 1.34, use User::getBlock() or
+ * PermissionManager::isBlockedFrom() or
+ * PermissionManager::userCan() instead.
+ *
* @param bool $fromReplica Whether to check the replica DB instead of
* the master. Hacked from false due to horrible probs on site.
* @return bool True if blocked, false otherwise
// $user->isAllowed(). It is also checked in Title::checkUserBlock()
// to give a better error message in the common case.
$config = RequestContext::getMain()->getConfig();
+ // @TODO Partial blocks should not prevent the user from logging in.
+ // see: https://phabricator.wikimedia.org/T208895
if (
$this->isLoggedIn() &&
$config->get( 'BlockDisablesLogin' ) &&
- $this->isBlocked()
+ $this->getBlock()
) {
$anon = new User;
$this->mRights = array_intersect( $this->mRights, $anon->getRights() );
* @return bool A block was spread
*/
public function spreadAnyEditBlock() {
- if ( $this->isLoggedIn() && $this->isBlocked() ) {
+ if ( $this->isLoggedIn() && $this->getBlock() ) {
return $this->spreadBlock();
}
if ( $checkUserBlock && ( ( $processed % $checkUserBlock ) == 0 ) ) {
$user->clearInstanceCache( 'name' ); // reload from DB!
- if ( $user->isBlocked() ) {
+ // @TODO Use PermissionManager::isBlockedFrom() instead.
+ if ( $user->getBlock() ) {
$this->output( $user->getName() . " was blocked! Aborting.\n" );
break;
}
'oojs-ui-widgets',
'mediawiki.widgets.styles',
// TitleInputWidget
+ 'oojs-ui.styles.icons-content',
'mediawiki.Title',
'mediawiki.api',
'mediawiki.String',
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M5 3v14.25C5 19.208 6.582 21 8.502 21H19V3zm8.002 3h4v4l-1.281-1.281L12.44 12l3.281 3.281L17.002 14v4h-4l1.313-1.313L10.596 13H7.002v-2h3.594l3.688-3.719z"/>
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+ <path d="m5 1c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h10c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2h-10zm6.002 3h4v4l-1.2812-1.2812-3.2812 3.2812 3.2812 3.2812 1.2812-1.2812v4h-4l1.3125-1.3125-3.7187-3.6875h-3.5938v-2h3.5938l3.6875-3.7188-1.2812-1.2812z"/>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M19 3v14.25c0 1.958-1.582 3.75-3.502 3.75H5V3zm-8.002 3h-4v4l1.281-1.281L11.56 12l-3.28 3.281L6.998 14v4h4l-1.313-1.313L13.404 13h3.594v-2h-3.594L9.716 7.281z"/>
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+ <path d="m15 1c1.1 0 2 0.9 2 2v14c0 1.1-0.9 2-2 2h-10c-1.1 0-2-0.9-2-2v-14c0-1.1 0.9-2 2-2zm-6.002 3h-4v4l1.2812-1.2812 3.2812 3.2812-3.2812 3.2812-1.2812-1.2812v4h4l-1.3125-1.3125 3.7188-3.6875h3.5938v-2h-3.5938l-3.6875-3.7188z"/>
</svg>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M12 12h5V5h-5zm-5 3v1h10v-1m0-1v-1H7v1m0 4h10v-1H7zm4-11H7v1h4zm0 3V9H7v1m0 1v1h4v-1m0-6H7v1h4zM5 3h14v18H8.692C6.602 21 5 19.373 5 17.25z"/>
-</svg>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M12 12H7V5h5zm5 3v1H7v-1m0-1v-1h10v1m0 4H7v-1h10zM13 7h4v1h-4zm0 3V9h4v1m0 1v1h-4v-1m0-6h4v1h-4zm6-2H5v18h10.308C17.398 21 19 19.373 19 17.25z"/>
-</svg>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M5 3v18h10c2 0 4-2 4-4V3zm7.644 13.572h-1.687v-1.6h1.687zm1.982-6a2.144 2.144 0 0 1-.25.563c-.104.16-.225.3-.36.423l-.402.364-.438.396c-.134.127-.25.273-.353.428-.103.16-.18.346-.233.555-.054.215-.08.474-.08.784h-1.36c0-.378.017-.696.057-.955.036-.26.098-.488.183-.688.085-.196.188-.37.31-.52.12-.15.267-.295.433-.44l.385-.332c.12-.105.233-.214.327-.34.098-.124.17-.265.228-.42a1.67 1.67 0 0 0 .08-.55c0-.256-.044-.48-.133-.66a1.397 1.397 0 0 0-.322-.442 1.35 1.35 0 0 0-.403-.246 1.17 1.17 0 0 0-.376-.077c-.52 0-.905.173-1.15.52-.247.345-.372.81-.372 1.39H8.962c0-.468.067-.895.206-1.282a2.641 2.641 0 0 1 1.561-1.619c.37-.15.79-.223 1.252-.223.385 0 .743.06 1.078.174.33.114.622.282.868.5.246.218.443.487.586.814.143.323.215.692.215 1.1-.01.306-.04.565-.104.784z"/>
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+ <path d="m5 1c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h10c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2h-10zm4.9805 4.2012c0.385 0 0.74313 0.059828 1.0781 0.17383 0.33 0.114 0.62314 0.282 0.86914 0.5s0.44294 0.48745 0.58594 0.81445c0.143 0.323 0.21484 0.69161 0.21484 1.0996-0.009999 0.306-0.041469 0.5642-0.10547 0.7832h0.003906a2.144 2.144 0 0 1-0.25 0.5625c-0.104 0.16-0.22633 0.30083-0.36133 0.42383l-0.40234 0.36328-0.4375 0.39648c-0.134 0.127-0.25052 0.27274-0.35352 0.42774-0.103 0.16-0.17942 0.34569-0.23242 0.55469-0.054 0.215-0.080078 0.47516-0.080078 0.78516h-1.3594c0-0.378 0.016641-0.69608 0.056641-0.95508 0.036-0.26 0.098594-0.48945 0.18359-0.68945 0.085-0.196 0.18659-0.36953 0.30859-0.51953 0.12-0.15 0.26759-0.29445 0.43359-0.43945l0.38477-0.33203c0.12-0.105 0.23412-0.21384 0.32812-0.33984 0.098-0.124 0.16856-0.26492 0.22656-0.41992a1.67 1.67 0 0 0 0.080078-0.55078c0-0.256-0.043813-0.48016-0.13281-0.66016a1.397 1.397 0 0 0-0.32226-0.44141 1.35 1.35 0 0 0-0.40234-0.24609 1.17 1.17 0 0 0-0.375-0.078125c-0.52 0-0.90539 0.17448-1.1504 0.52148-0.247 0.345-0.37305 0.80867-0.37305 1.3887h-1.4336c0-0.468 0.066078-0.89425 0.20508-1.2812a2.641 2.641 0 0 1 1.5605-1.6191c0.37-0.15 0.78995-0.22266 1.252-0.22266zm-1.0234 7.7715h1.6875v1.5996h-1.6875v-1.5996z"/>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M5 3v14c0 2.125 1.911 4 4 4h10V3zm7.644 13.572h-1.687v-1.601h1.687zm1.982-6.001a2.106 2.106 0 0 1-.609.987l-.403.364-.438.396a2.422 2.422 0 0 0-.353.428 1.881 1.881 0 0 0-.233.555 3.236 3.236 0 0 0-.081.783h-1.36c0-.378.018-.696.058-.955a2.7 2.7 0 0 1 .183-.687c.085-.196.188-.369.309-.519a3.59 3.59 0 0 1 .434-.441l.385-.332a2.15 2.15 0 0 0 .327-.341c.098-.123.17-.264.228-.419.054-.155.081-.337.081-.551a1.5 1.5 0 0 0-.134-.66 1.388 1.388 0 0 0-.322-.441 1.35 1.35 0 0 0-.403-.246 1.17 1.17 0 0 0-.376-.077c-.519 0-.904.173-1.15.519-.246.346-.371.81-.371 1.392H8.962c0-.469.067-.896.206-1.283a2.641 2.641 0 0 1 1.561-1.619 3.33 3.33 0 0 1 1.253-.223c.385 0 .743.059 1.078.173.331.114.622.282.868.5.246.218.443.487.586.814a2.7 2.7 0 0 1 .215 1.101c-.009.305-.04.564-.103.783z"/>
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+ <path d="m5 1c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h10c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2h-10zm4.9805 4.2012c0.385 0 0.74313 0.059828 1.0781 0.17383 0.33 0.114 0.62314 0.282 0.86914 0.5s0.44294 0.48745 0.58594 0.81445c0.143 0.323 0.21484 0.69161 0.21484 1.0996-0.009999 0.306-0.041469 0.5642-0.10547 0.7832h0.003906a2.144 2.144 0 0 1-0.25 0.5625c-0.104 0.16-0.22633 0.30083-0.36133 0.42383l-0.40234 0.36328-0.4375 0.39648c-0.134 0.127-0.25052 0.27274-0.35352 0.42774-0.103 0.16-0.17942 0.34569-0.23242 0.55469-0.054 0.215-0.080078 0.47516-0.080078 0.78516h-1.3594c0-0.378 0.016641-0.69608 0.056641-0.95508 0.036-0.26 0.098594-0.48945 0.18359-0.68945 0.085-0.196 0.18659-0.36953 0.30859-0.51953 0.12-0.15 0.26759-0.29445 0.43359-0.43945l0.38477-0.33203c0.12-0.105 0.23412-0.21384 0.32812-0.33984 0.098-0.124 0.16856-0.26492 0.22656-0.41992a1.67 1.67 0 0 0 0.080078-0.55078c0-0.256-0.043813-0.48016-0.13281-0.66016a1.397 1.397 0 0 0-0.32226-0.44141 1.35 1.35 0 0 0-0.40234-0.24609 1.17 1.17 0 0 0-0.375-0.078125c-0.52 0-0.90539 0.17448-1.1504 0.52148-0.247 0.345-0.37305 0.80867-0.37305 1.3887h-1.4336c0-0.468 0.066078-0.89425 0.20508-1.2812a2.641 2.641 0 0 1 1.5605-1.6191c0.37-0.15 0.78995-0.22266 1.252-0.22266zm-1.0234 7.7715h1.6875v1.5996h-1.6875v-1.5996z"/>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M19 3v14c0 2.125-1.911 4-4 4H5V3zm-7.644 13.572h1.687v-1.601h-1.687zm-1.982-6.001a2.106 2.106 0 0 0 .609.987l.403.364.438.396c.134.127.251.273.353.428.103.159.179.346.233.555.054.214.081.473.081.783h1.36c0-.378-.018-.696-.058-.955a2.7 2.7 0 0 0-.183-.687 2.242 2.242 0 0 0-.309-.519 3.59 3.59 0 0 0-.434-.441l-.385-.332a2.15 2.15 0 0 1-.327-.341 1.513 1.513 0 0 1-.228-.419 1.671 1.671 0 0 1-.081-.551 1.5 1.5 0 0 1 .134-.66c.089-.182.197-.332.322-.441a1.35 1.35 0 0 1 .403-.246 1.17 1.17 0 0 1 .376-.077c.519 0 .904.173 1.15.519.246.346.371.81.371 1.392h1.436a3.77 3.77 0 0 0-.206-1.283 2.641 2.641 0 0 0-1.561-1.619 3.33 3.33 0 0 0-1.253-.223c-.385 0-.743.059-1.078.173a2.548 2.548 0 0 0-.868.5 2.304 2.304 0 0 0-.586.814 2.7 2.7 0 0 0-.215 1.101c.009.305.04.564.103.783z"/>
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+ <path d="m15 1c1.1 0 2 0.9 2 2v14c0 1.1-0.9 2-2 2h-10c-1.1 0-2-0.9-2-2v-14c0-1.1 0.9-2 2-2zm-4.9805 4.2012c-0.385 0-0.74312 0.059828-1.0781 0.17383-0.33 0.114-0.62314 0.282-0.86914 0.5s-0.44294 0.48745-0.58594 0.81445c-0.143 0.323-0.21484 0.69161-0.21484 1.0996 0.01 0.306 0.041469 0.5642 0.10547 0.7832h-0.00391a2.144 2.144 0 0 0 0.25 0.5625c0.104 0.16 0.22633 0.30083 0.36133 0.42383l0.40234 0.36328 0.4375 0.39648c0.134 0.127 0.25052 0.27274 0.35352 0.42774 0.103 0.16 0.17942 0.34569 0.23242 0.55469 0.054 0.215 0.080078 0.47516 0.080078 0.78516h1.3594c0-0.378-0.01664-0.69608-0.05664-0.95508-0.036-0.26-0.09859-0.48945-0.18359-0.68945-0.085-0.196-0.18659-0.36953-0.30859-0.51953-0.12-0.15-0.26759-0.29445-0.43359-0.43945l-0.38476-0.33203c-0.12-0.105-0.23412-0.21384-0.32812-0.33984-0.098-0.124-0.16856-0.26492-0.22656-0.41992a1.67 1.67 0 0 1-0.080078-0.55078c0-0.256 0.043813-0.48016 0.13281-0.66016a1.397 1.397 0 0 1 0.32226-0.44141 1.35 1.35 0 0 1 0.40234-0.24609 1.17 1.17 0 0 1 0.375-0.078125c0.52 0 0.90539 0.17448 1.1504 0.52148 0.247 0.345 0.37305 0.80867 0.37305 1.3887h1.4336c0-0.468-0.06608-0.89425-0.20508-1.2812a2.641 2.641 0 0 0-1.5605-1.6191c-0.37-0.15-0.78995-0.22266-1.252-0.22266zm1.0234 7.7715h-1.6875v1.5996h1.6875z"/>
</svg>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M5 3v14c0 2.552 1.516 4 4 4h10V3H5zm9.375 3.781c1.384 0 2.655 1.208 2.781 2.625 0 .838-.373 1.546-.937 2.125l-1.657 1.688c-.438.517-1.12.812-1.874.812-1.133 0-1.903-.69-2.407-1.656l.813-.844c.312.709.776 1.281 1.656 1.281.378 0 .873-.178 1.125-.437l1.656-1.688a1.65 1.65 0 0 0 0-2.312c-.312-.258-.778-.469-1.156-.469-.755 0-1.247.577-1.75 1.094-.312-.13-.625-.156-.938-.156-.186 0-.374.031-.5.031.942-.905 1.869-2.094 3.188-2.094zm-3.281 2.782c1.132 0 1.903.72 2.406 1.687l-.813.813c-.312-.647-.744-1.282-1.624-1.282-.378 0-.874.21-1.126.469l-1.656 1.656c-.629.58-.629 1.666 0 2.313.312.258.748.469 1.125.469.378 0 .874-.21 1.125-.47l.563-.593c.251.13.5.156.812.156.187 0 .376 0 .563-.062l-1.156 1.219c-.942 1.096-2.712 1.033-3.72 0-1.067-1.034-1.067-2.775 0-3.876l1.626-1.656a2.454 2.454 0 0 1 1.875-.844z"/>
-</svg>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
- <path d="M19 3v14c0 2.552-1.516 4-4 4H5V3h14zM9.625 6.781c-1.384 0-2.655 1.208-2.781 2.625 0 .838.373 1.546.937 2.125l1.657 1.688c.438.517 1.12.812 1.874.812 1.133 0 1.903-.69 2.407-1.656l-.813-.844c-.312.709-.776 1.281-1.656 1.281-.378 0-.873-.178-1.125-.437l-1.656-1.688a1.652 1.652 0 0 1 0-2.312c.312-.258.778-.469 1.156-.469.755 0 1.247.577 1.75 1.094.312-.13.625-.156.938-.156.186 0 .374.031.5.031-.942-.905-1.869-2.094-3.188-2.094zm3.281 2.782c-1.132 0-1.903.72-2.406 1.687l.813.813c.312-.647.744-1.282 1.624-1.282.378 0 .874.21 1.126.469l1.656 1.656c.629.58.629 1.666 0 2.313-.312.258-.748.469-1.125.469-.378 0-.874-.21-1.125-.47l-.563-.593c-.251.13-.5.156-.812.156-.187 0-.376 0-.563-.062l1.156 1.219c.942 1.096 2.712 1.033 3.72 0 1.067-1.034 1.067-2.775 0-3.876l-1.626-1.656a2.454 2.454 0 0 0-1.875-.844z"/>
-</svg>
} else if ( config.missing ) {
icon = 'page-not-found';
} else if ( config.redirect ) {
- icon = 'page-redirect';
+ icon = 'articleRedirect';
} else if ( config.disambiguation ) {
icon = 'page-disambiguation';
} else {
- icon = 'page-existing';
+ icon = 'article';
}
// Config initialization
left: 0;
&:not( .mw-widget-titleOptionWidget-hasImage ) {
+ background-size: 80%;
background-color: #c8ccd1;
opacity: 0.4;
}
background-image: url( images/page-disambiguation-ltr.svg );
}
-.oo-ui-icon-page-existing {
- /* @embed */
- background-image: url( images/page-existing-ltr.svg );
-}
-
.oo-ui-icon-page-not-found {
/* @embed */
background-image: url( images/page-not-found-ltr.svg );
}
-.oo-ui-icon-page-not-found:lang( he ) {
+.oo-ui-icon-page-not-found:lang( he ),
+.oo-ui-icon-page-not-found:lang( yi ) {
/* @embed */
background-image: url( images/page-not-found-he-yi.svg );
}
-
-.oo-ui-icon-page-redirect {
- /* @embed */
- background-image: url( images/page-redirect-ltr.svg );
-}
$store = new CachingSiteStore(
$this->getHashSiteStore( $testSites ),
- wfGetMainCache()
+ ObjectCache::getLocalClusterInstance()
);
$sites = $store->getSites();
* @covers CachingSiteStore::saveSites
*/
public function testSaveSites() {
- $store = new CachingSiteStore( new HashSiteStore(), wfGetMainCache() );
+ $store = new CachingSiteStore(
+ new HashSiteStore(), ObjectCache::getLocalClusterInstance()
+ );
$sites = [];
return $siteList;
} ) );
- $store = new CachingSiteStore( $dbSiteStore, wfGetMainCache() );
+ $store = new CachingSiteStore( $dbSiteStore, ObjectCache::getLocalClusterInstance() );
// initialize internal cache
$this->assertGreaterThan( 0, $store->getSites()->count(), 'count sites' );
* @covers CachingSiteStore::clear
*/
public function testClear() {
- $store = new CachingSiteStore( new HashSiteStore(), wfGetMainCache() );
+ $store = new CachingSiteStore(
+ new HashSiteStore(), ObjectCache::getLocalClusterInstance()
+ );
$this->assertTrue( $store->clear() );
$site = $store->getSite( 'enwiki' );
// Confirm that the block has been applied as required.
$this->assertTrue( $user1->isLoggedIn() );
- $this->assertTrue( $user1->isBlocked() );
+ $this->assertInstanceOf( Block::class, $user1->getBlock() );
$this->assertEquals( Block::TYPE_USER, $block->getType() );
$this->assertTrue( $block->isAutoblocking() );
$this->assertGreaterThanOrEqual( 1, $block->getId() );
$this->assertNotEquals( $user1->getToken(), $user2->getToken() );
$this->assertTrue( $user2->isAnon() );
$this->assertFalse( $user2->isLoggedIn() );
- $this->assertTrue( $user2->isBlocked() );
+ $this->assertInstanceOf( Block::class, $user2->getBlock() );
// Non-strict type-check.
$this->assertEquals( true, $user2->getBlock()->isAutoblocking(), 'Autoblock does not work' );
// Can't directly compare the objects because of member type differences.
$user3 = User::newFromSession( $request3 );
$user3->load();
$this->assertTrue( $user3->isLoggedIn() );
- $this->assertTrue( $user3->isBlocked() );
+ $this->assertInstanceOf( Block::class, $user3->getBlock() );
$this->assertEquals( true, $user3->getBlock()->isAutoblocking() ); // Non-strict type-check.
// Clean up.
// 2. Test that the cookie IS NOT present.
$this->assertTrue( $user->isLoggedIn() );
- $this->assertTrue( $user->isBlocked() );
+ $this->assertInstanceOf( Block::class, $user->getBlock() );
$this->assertEquals( Block::TYPE_USER, $block->getType() );
$this->assertTrue( $block->isAutoblocking() );
$this->assertGreaterThanOrEqual( 1, $user->getBlockId() );
// 2. Test the cookie's expiry timestamp.
$this->assertTrue( $user1->isLoggedIn() );
- $this->assertTrue( $user1->isBlocked() );
+ $this->assertInstanceOf( Block::class, $user1->getBlock() );
$this->assertEquals( Block::TYPE_USER, $block->getType() );
$this->assertTrue( $block->isAutoblocking() );
$this->assertGreaterThanOrEqual( 1, $user1->getBlockId() );
$user2->load();
$this->assertTrue( $user2->isAnon() );
$this->assertFalse( $user2->isLoggedIn() );
- $this->assertFalse( $user2->isBlocked() );
+ $this->assertNull( $user2->getBlock() );
// Clean up.
$block->delete();
$user1 = User::newFromSession( $request1 );
$user1->mBlock = $block;
$user1->load();
- $this->assertTrue( $user1->isBlocked() );
+ $this->assertInstanceOf( Block::class, $user1->getBlock() );
// 2. Create a new request, set the cookie to just the block ID, and the user should
// still get blocked when they log in again.
$this->assertNotEquals( $user1->getToken(), $user2->getToken() );
$this->assertTrue( $user2->isAnon() );
$this->assertFalse( $user2->isLoggedIn() );
- $this->assertTrue( $user2->isBlocked() );
+ $this->assertInstanceOf( Block::class, $user2->getBlock() );
$this->assertEquals( true, $user2->getBlock()->isAutoblocking() ); // Non-strict type-check.
// Clean up.
$user = User::newFromSession( $request );
// logged in users should be inmune to cookie block of type ip/range
- $this->assertFalse( $user->isBlocked() );
+ $this->assertNull( $user->getBlock() );
// cookie is being cleared
$cookies = $request->response()->getCookies();
$wgParserCacheType = CACHE_NONE;
DeferredUpdates::clearPendingUpdates();
- $wgMemc = wfGetMainCache();
+ $wgMemc = ObjectCache::getLocalClusterInstance();
$messageMemc = wfGetMessageCacheStorage();
RequestContext::resetMain();