resourceloader: Define the default language and skin in constants
[lhc/web/wiklou.git] / includes / EditPage.php
index ab7d6bb..d27ef9c 100644 (file)
@@ -20,6 +20,7 @@
  * @file
  */
 
+use MediaWiki\Block\DatabaseBlock;
 use MediaWiki\EditPage\TextboxBuilder;
 use MediaWiki\EditPage\TextConflictHelper;
 use MediaWiki\Logger\LoggerFactory;
@@ -621,7 +622,8 @@ class EditPage {
 
                        if ( $this->context->getUser()->getBlock() ) {
                                // track block with a cookie if it doesn't exists already
-                               $this->context->getUser()->trackBlockWithCookie();
+                               MediaWikiServices::getInstance()->getBlockManager()
+                                       ->trackBlockWithCookie( $this->context->getUser() );
 
                                // Auto-block user's IP if the account was "hard" blocked
                                if ( !wfReadOnly() ) {
@@ -2590,7 +2592,7 @@ ERROR;
                        }
                } elseif ( $namespace == NS_FILE ) {
                        # Show a hint to shared repo
-                       $file = wfFindFile( $this->mTitle );
+                       $file = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $this->mTitle );
                        if ( $file && !$file->isLocal() ) {
                                $descUrl = $file->getDescriptionUrl();
                                # there must be a description url to show a hint to shared repo
@@ -2614,13 +2616,13 @@ ERROR;
                        $username = explode( '/', $this->mTitle->getText(), 2 )[0];
                        $user = User::newFromName( $username, false /* allow IP users */ );
                        $ip = User::isIP( $username );
-                       $block = Block::newFromTarget( $user, $user );
+                       $block = DatabaseBlock::newFromTarget( $user, $user );
                        if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist
                                $out->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n$1\n</div>",
                                        [ 'userpage-userdoesnotexist', wfEscapeWikiText( $username ) ] );
                        } elseif (
                                !is_null( $block ) &&
-                               $block->getType() != Block::TYPE_AUTO &&
+                               $block->getType() != DatabaseBlock::TYPE_AUTO &&
                                ( $block->isSitewide() || $user->isBlockedFrom( $this->mTitle ) )
                        ) {
                                // Show log extract if the user is sitewide blocked or is partially
@@ -4128,7 +4130,7 @@ ERROR;
 
                if ( !Hooks::run( 'EditPageBeforeEditToolbar', [ &$toolbar ] ) ) {
                        return null;
-               };
+               }
                // Don't add a pointless `<div>` to the page unless a hook caller populated it
                return ( $toolbar === $startingToolbar ) ? null : $toolbar;
        }