Nikerabbit has submitted this change and it was merged.

Change subject: Replace some deprecated functions
......................................................................


Replace some deprecated functions

* Raises minimum MediaWiki version to 1.19.
* Removed unused globals and local variables.

Change-Id: Ic799b25fcc2cd1a270eeaad62a754a205e7c45a2
---
M README
M SpecialWikilog.php
M WikilogComment.php
M WikilogCommentPager.php
M WikilogCommentsPage.php
M WikilogFeed.php
M WikilogHooks.php
M WikilogItem.php
M WikilogItemPage.php
M WikilogItemPager.php
M WikilogMainPage.php
M WikilogParser.php
M WlCaptchaAdapter.php
13 files changed, 52 insertions(+), 77 deletions(-)

Approvals:
  Nikerabbit: Verified; Looks good to me, approved



diff --git a/README b/README
index 883bd21..c2a9ef5 100644
--- a/README
+++ b/README
@@ -33,7 +33,7 @@
 
 == Requirements ==
 
-* MediaWiki 1.17 or higher.
+* MediaWiki 1.19 or higher.
 * A MySQL database backend.
 
 == Installation ==
diff --git a/SpecialWikilog.php b/SpecialWikilog.php
index 2456ac8..e1c9c91 100644
--- a/SpecialWikilog.php
+++ b/SpecialWikilog.php
@@ -128,7 +128,7 @@
         * @param $opts Form options, such as wikilog name, category, date, etc.
         */
        public function webOutput( FormOptions $opts ) {
-               global $wgRequest, $wgOut, $wgMimeType, $wgTitle, $wgParser;
+               global $wgOut, $wgMimeType, $wgTitle, $wgParser;
 
                # Set page title, html title, nofollow, noindex, etc...
                $this->setHeaders();
diff --git a/WikilogComment.php b/WikilogComment.php
index 1aaced0..72eca20 100644
--- a/WikilogComment.php
+++ b/WikilogComment.php
@@ -524,7 +524,6 @@
  */
 class WikilogCommentFormatter
 {
-       protected $mSkin;               ///< Skin used when rendering comments.
        protected $mAllowReplies;       ///< Whether to show reply links.
        protected $mAllowModeration;    ///< User is allowed to moderate.
        protected $mPermalinkTitle;     ///< Optional title used for permalinks.
@@ -543,9 +542,8 @@
         * @param $wi WikilogInfo object with information about the wikilog and
         *   the item.
         */
-       public function __construct( $skin = false, $allowReplies = false ) {
+       public function __construct( $allowReplies = false ) {
                global $wgUser;
-               $this->mSkin = $skin ? $skin : $wgUser->getSkin();
                $this->mAllowReplies = $allowReplies;
                $this->mAllowModeration = $wgUser->isAllowed( 'wl-moderation' );
        }
@@ -575,8 +573,6 @@
         * @return Generated HTML.
         */
        public function formatComment( $comment, $highlight = false ) {
-               global $wgUser, $wgOut;
-
                $hidden = WikilogComment::$statusMap[ $comment->mStatus ];
 
                # div class.
@@ -700,15 +696,15 @@
                        $authorPlain = htmlspecialchars( $comment->mUserText );
                        $authorFmt = wfMsgExt( 'wikilog-simple-signature',
                                array( 'content', 'parseinline', 'replaceafter' 
),
-                               Xml::wrapClass( $this->mSkin->userLink( 
$comment->mUserID, $comment->mUserText ), 'wl-comment-author' ),
-                               $this->mSkin->userTalkLink( $comment->mUserID, 
$comment->mUserText ),
+                               Xml::wrapClass( Linker::userLink( 
$comment->mUserID, $comment->mUserText ), 'wl-comment-author' ),
+                               Linker::userTalkLink( $comment->mUserID, 
$comment->mUserText ),
                                $comment->mUserText
                        );
                } else {
                        $authorPlain = htmlspecialchars( $comment->mAnonName );
                        $authorFmt = wfMsgForContent( 'wikilog-comment-anonsig',
-                               Xml::wrapClass( $this->mSkin->userLink( 
$comment->mUserID, $comment->mUserText ), 'wl-comment-author' ),
-                               $this->mSkin->userTalkLink( $comment->mUserID, 
$comment->mUserText ),
+                               Xml::wrapClass( Linker::userLink( 
$comment->mUserID, $comment->mUserText ), 'wl-comment-author' ),
+                               Linker::userTalkLink( $comment->mUserID, 
$comment->mUserText ),
                                htmlspecialchars( $comment->mAnonName )
                        );
                }
@@ -720,7 +716,7 @@
                if ( $this->mShowItem && $comment->mItem ) {
                        # Display item title.
                        $extra[] = wfMsgForContent( 'wikilog-comment-note-item',
-                               $this->mSkin->link( $comment->mItem->mTitle, 
$comment->mItem->mName )
+                               Linker::link( $comment->mItem->mTitle, 
$comment->mItem->mName )
                        );
                }
                if ( $comment->mID && $comment->mCommentTitle &&
@@ -729,7 +725,7 @@
                        if ( $comment->mUpdated != $comment->mTimestamp ) {
                                # Comment was edited.
                                list( $updDate, $updTime, $updTz ) = 
WikilogUtils::getLocalDateTime( $comment->mUpdated );
-                               $extra[] = $this->mSkin->link( 
$comment->mCommentTitle,
+                               $extra[] = Linker::link( 
$comment->mCommentTitle,
                                        wfMsgForContent( 
'wikilog-comment-note-edited', $updDate, $updTime, $updTz ),
                                        array( 'title' => wfMsg( 
'wikilog-comment-history' ) ),
                                        array( 'action' => 'history' ), 'known'
@@ -837,7 +833,7 @@
                        } else {
                                $title = $comment->mCommentTitle;
                        }
-                       return $this->mSkin->link( $title,
+                       return Linker::link( $title,
                                wfMsg( 'wikilog-comment-permalink', $date, 
$time, $tz ),
                                array( 'title' => wfMsg( 'permalink' ) )
                        );
@@ -869,8 +865,8 @@
                                );
                        }
                        if ( $this->mAllowModeration && $comment->mStatus == 
WikilogComment::S_PENDING ) {
-                               $token = $wgUser->editToken();
-                               $tools['approve'] = $this->mSkin->link( 
$comment->mCommentTitle,
+                               $token = $wgUser->getEditToken();
+                               $tools['approve'] = Linker::link( 
$comment->mCommentTitle,
                                        wfMsg( 'wikilog-approve-lc' ),
                                        array( 'title' => wfMsg( 
'wikilog-comment-approve' ) ),
                                        array(
@@ -880,7 +876,7 @@
                                        ),
                                        'known'
                                );
-                               $tools['reject'] = $this->mSkin->link( 
$comment->mCommentTitle,
+                               $tools['reject'] = Linker::link( 
$comment->mCommentTitle,
                                        wfMsg( 'wikilog-reject-lc' ),
                                        array( 'title' => wfMsg( 
'wikilog-comment-reject' ) ),
                                        array(
@@ -892,7 +888,7 @@
                                );
                        }
                        if ( $this->mAllowModeration ) {
-                               $tools['page'] = $this->mSkin->link( 
$comment->mCommentTitle,
+                               $tools['page'] = Linker::link( 
$comment->mCommentTitle,
                                        wfMsg( 'wikilog-page-lc' ),
                                        array( 'title' => wfMsg( 
'wikilog-comment-page' ) ),
                                        array(),
@@ -900,7 +896,7 @@
                                );
                        }
                        if ( $comment->mCommentTitle->quickUserCan( 'edit' ) ) {
-                               $tools['edit'] = $this->mSkin->link( 
$comment->mCommentTitle,
+                               $tools['edit'] = Linker::link( 
$comment->mCommentTitle,
                                        wfMsg( 'wikilog-edit-lc' ),
                                        array( 'title' => wfMsg( 
'wikilog-comment-edit' ) ),
                                        array( 'action' => 'edit' ),
@@ -908,7 +904,7 @@
                                );
                        }
                        if ( $comment->mCommentTitle->quickUserCan( 'delete' ) 
) {
-                               $tools['delete'] = $this->mSkin->link( 
$comment->mCommentTitle,
+                               $tools['delete'] = Linker::link( 
$comment->mCommentTitle,
                                        wfMsg( 'wikilog-delete-lc' ),
                                        array( 'title' => wfMsg( 
'wikilog-comment-delete' ) ),
                                        array( 'action' => 'delete' ),
diff --git a/WikilogCommentPager.php b/WikilogCommentPager.php
index 0b39333..e68cca1 100644
--- a/WikilogCommentPager.php
+++ b/WikilogCommentPager.php
@@ -63,7 +63,6 @@
        function __construct( WikilogCommentQuery $query, $formatter = null,
                        $including = false )
        {
-               global $wgUser, $wgParser;
                global $wgWikilogNumComments, $wgWikilogExpensiveLimit;
 
                # WikilogCommentQuery object drives our queries.
@@ -72,7 +71,7 @@
 
                # Prepare the comment formatter.
                $this->mFormatter = $formatter ? $formatter :
-                       new WikilogCommentFormatter( $this->getSkin() );
+                       new WikilogCommentFormatter();
 
                # Parent constructor.
                parent::__construct();
diff --git a/WikilogCommentsPage.php b/WikilogCommentsPage.php
index 39988d5..de0ae13 100644
--- a/WikilogCommentsPage.php
+++ b/WikilogCommentsPage.php
@@ -48,7 +48,6 @@
        extends Article
        implements WikilogCustomAction
 {
-       protected $mSkin;                               ///< Skin used when 
rendering the page.
        protected $mFormatter;                  ///< Comment formatter.
        protected $mFormOptions;                ///< Post comment form fields.
        protected $mUserCanPost;                ///< User is allowed to post.
@@ -78,9 +77,8 @@
                        ( $wgUser->isAllowed( 'edit' ) && $wgUser->isAllowed( 
'createtalk' ) );
                $this->mUserCanModerate = $wgUser->isAllowed( 'wl-moderation' );
 
-               # Prepare the skin and the comment formatter.
-               $this->mSkin = $wgUser->getSkin();
-               $this->mFormatter = new WikilogCommentFormatter( $this->mSkin, 
$this->mUserCanPost );
+               # Prepare the comment formatter.
+               $this->mFormatter = new WikilogCommentFormatter( 
$this->mUserCanPost );
 
                # Get item object relative to this comments page.
                $this->mItem = WikilogItem::newFromInfo( $wi );
@@ -160,7 +158,7 @@
                }
 
                # Add a backlink to the original article.
-               $link = $this->mSkin->link( $this->mItem->mTitle,
+               $link = Linker::link( $this->mItem->mTitle,
                        Sanitizer::escapeHtmlAllowEntities( $this->mItem->mName 
) );
                $wgOut->setSubtitle( wfMsg( 'wikilog-backlink', $link ) );
 
@@ -241,8 +239,7 @@
                if ( $wgRequest->wasPosted() ) {
                        # HTTP post: either comment preview or submission.
                        if ( !$this->mUserCanPost ) {
-                               $wgOut->permissionRequired( 'wl-postcomment' );
-                               return;
+                               throw new PermissionsError( 'wl-postcomment' );
                        }
                        $this->mPostedComment = $this->getPostedComment();
                        if ( $this->mPostedComment ) {
@@ -293,7 +290,7 @@
         *   the given comment.
         */
        public function getPostCommentForm( $parent = null ) {
-               global $wgUser, $wgTitle, $wgScript, $wgRequest;
+               global $wgUser, $wgTitle, $wgScript;
                global $wgWikilogModerateAnonymous;
 
                $comment = $this->mPostedComment;
@@ -315,7 +312,7 @@
                $form =
                        Html::hidden( 'title', 
$this->getTitle()->getPrefixedText() ) .
                        Html::hidden( 'action', 'wikilog' ) .
-                       Html::hidden( 'wpEditToken', $wgUser->editToken() ) .
+                       Html::hidden( 'wpEditToken', $wgUser->getEditToken() ) .
                        ( $parent ? Html::hidden( 'wlParent', $parent->mID ) : 
'' );
 
                $fields = array();
@@ -323,11 +320,11 @@
                if ( $wgUser->isLoggedIn() ) {
                        $fields[] = array(
                                wfMsg( 'wikilog-form-name' ),
-                               $this->mSkin->userLink( $wgUser->getId(), 
$wgUser->getName() )
+                               Linker::userLink( $wgUser->getId(), 
$wgUser->getName() )
                        );
                } else {
                        $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
-                       $loginLink = $this->mSkin->link( $loginTitle,
+                       $loginLink = Linker::link( $loginTitle,
                                wfMsgHtml( 'loginreqlink' ), array(),
                                array( 'returnto' => $wgTitle->getPrefixedUrl() 
)
                        );
@@ -381,7 +378,7 @@
         *    Title::GAID_FOR_UPDATE.
         */
        protected function setCommentApproval( $comment, $approval ) {
-               global $wgOut, $wgUser;
+               global $wgOut;
 
                # Check if comment is really awaiting moderation.
                if ( $comment->mStatus != WikilogComment::S_PENDING ) {
diff --git a/WikilogFeed.php b/WikilogFeed.php
index 0c0943e..4d9d530 100644
--- a/WikilogFeed.php
+++ b/WikilogFeed.php
@@ -149,8 +149,6 @@
         * @param $feed Prepared syndication feed object.
         */
        public function printFeed( $feed ) {
-               global $wgOut, $wgFavicon;
-
                $feed->outHeader();
 
                $this->doQuery();
@@ -691,7 +689,7 @@
         * @return WlSyndicationFeed object.
         */
        public function getSiteFeedObject() {
-               global $wgContLanguageCode, $wgWikilogFeedClasses, $wgFavicon, 
$wgLogo;
+               global $wgContLanguageCode, $wgWikilogFeedClasses, $wgFavicon;
 
                $title = wfMsgForContent( 'wikilog-feed-title',
                        wfMsgForContent( 'wikilog-specialwikilogcomments-title' 
),
@@ -760,8 +758,6 @@
         * @return A new WlSyndicationEntry object.
         */
        function formatFeedEntry( $row ) {
-               global $wgMimeType;
-
                # Create comment object.
                $item = $this->mSingleItem ? $this->mSingleItem : 
WikilogItem::newFromRow( $row );
                $comment = WikilogComment::newFromRow( $item, $row );
diff --git a/WikilogHooks.php b/WikilogHooks.php
index 279aa6f..1abb03a 100644
--- a/WikilogHooks.php
+++ b/WikilogHooks.php
@@ -267,7 +267,7 @@
        static function EditPageEditFormFields( &$editpage, &$output ) {
                $wi = Wikilog::getWikilogInfo( $editpage->mTitle );
                if ( $wi && $wi->isItem() && !$wi->isTalk() ) {
-                       global $wgUser, $wgWikilogSignAndPublishDefault;
+                       global $wgWikilogSignAndPublishDefault;
                        $fields = array();
                        $item = WikilogItem::newFromInfo( $wi );
 
diff --git a/WikilogItem.php b/WikilogItem.php
index 14a4fed..67bbbaa 100644
--- a/WikilogItem.php
+++ b/WikilogItem.php
@@ -164,7 +164,7 @@
         * parameters.
         */
        public function getMsgParams( $extended = false, $pout = null ) {
-               global $wgContLang, $wgWikilogEnableTags;
+               global $wgWikilogEnableTags;
 
                $authors = array_keys( $this->mAuthors );
                $authorsFmt = WikilogUtils::authorList( $authors );
diff --git a/WikilogItemPage.php b/WikilogItemPage.php
index 2c7d4ec..6e076fb 100644
--- a/WikilogItemPage.php
+++ b/WikilogItemPage.php
@@ -74,10 +74,7 @@
         * View page action handler.
         */
        public function view() {
-               global $wgOut, $wgUser, $wgContLang, $wgFeed, 
$wgWikilogFeedClasses;
-
-               # Get skin
-               $skin = $wgUser->getSkin();
+               global $wgOut, $wgFeed, $wgWikilogFeedClasses;
 
                if ( $this->mItem ) {
                        $params = $this->mItem->getMsgParams( true );
@@ -127,7 +124,6 @@
                        }
 
                        # Add feed links.
-                       $links = array();
                        if ( $wgFeed ) {
                                foreach ( $wgWikilogFeedClasses as $format => 
$class ) {
                                        $wgOut->addLink( array(
diff --git a/WikilogItemPager.php b/WikilogItemPager.php
index bee99fc..11dbe37 100644
--- a/WikilogItemPager.php
+++ b/WikilogItemPager.php
@@ -77,7 +77,7 @@
                parent::__construct();
 
                # Fix our limits, Pager's defaults are too high.
-               global $wgUser, $wgWikilogNumArticles;
+               global $wgWikilogNumArticles;
                $this->mDefaultLimit = $wgWikilogNumArticles;
 
                if ( $limit ) {
@@ -145,7 +145,6 @@
 
        function formatRow( $row ) {
                global $wgWikilogExtSummaries;
-               $skin = $this->getSkin();
                $header = $footer = '';
 
                # Retrieve article parser output and other data.
@@ -161,7 +160,7 @@
                $titleText = Sanitizer::escapeHtmlAllowEntities( $item->mName );
                if ( !$item->getIsPublished() )
                        $titleText .= wfMsgForContent( 
'wikilog-draft-title-mark' );
-               $heading = $skin->link( $item->mTitle, $titleText, array(), 
array(),
+               $heading = Linker::link( $item->mTitle, $titleText, array(), 
array(),
                        array( 'known', 'noclasses' )
                );
                if ( $this->mShowEditLink && $item->mTitle->quickUserCan( 
'edit' ) ) {
@@ -478,13 +477,13 @@
                        case 'wlw_title':
                                $page = $this->mCurrentItem->mParentTitle;
                                $text = Sanitizer::escapeHtmlAllowEntities( 
$this->mCurrentItem->mParentName );
-                               return $this->getSkin()->link( $page, $text, 
array(), array(),
+                               return Linker::link( $page, $text, array(), 
array(),
                                        array( 'known', 'noclasses' ) );
 
                        case 'wlp_title':
                                $page = $this->mCurrentItem->mTitle;
                                $text = Sanitizer::escapeHtmlAllowEntities( 
$this->mCurrentItem->mName );
-                               $s = $this->getSkin()->link( $page, $text, 
array(), array(),
+                               $s = Linker::link( $page, $text, array(), 
array(),
                                        array( 'known', 'noclasses' ) );
                                if ( !$this->mCurrentRow->wlp_publish ) {
                                        $draft = wfMsg( 
'wikilog-draft-title-mark' );
@@ -495,7 +494,7 @@
                        case 'wlp_num_comments':
                                $page = 
$this->mCurrentItem->mTitle->getTalkPage();
                                $text = $this->mCurrentItem->getNumComments();
-                               return $this->getSkin()->link( $page, $text, 
array(), array(),
+                               return Linker::link( $page, $text, array(), 
array(),
                                        array( 'known', 'noclasses' ) );
 
                        case '_wl_actions':
@@ -559,9 +558,8 @@
         * @return Resulting HTML fragment.
         */
        private function authorLink( $name ) {
-               $skin = $this->getSkin();
                $title = Title::makeTitle( NS_USER, $name );
-               return $skin->link( $title, $name );
+               return Linker::link( $title, $name );
        }
 
        /**
@@ -573,7 +571,6 @@
         * @return string  HTML fragment.
         */
        private function doEditLink( $title, $tooltip = null ) {
-               $skin = $this->getSkin();
                $attribs = array();
                if ( !is_null( $tooltip ) ) {
                        $attribs['title'] = wfMsg( 'wikilog-edit-hint', 
$tooltip );
diff --git a/WikilogMainPage.php b/WikilogMainPage.php
index 40a2a78..d7a7ce5 100644
--- a/WikilogMainPage.php
+++ b/WikilogMainPage.php
@@ -132,7 +132,7 @@
         * Wikilog action handler.
         */
        public function wikilog() {
-               global $wgUser, $wgOut, $wgRequest;
+               global $wgOut, $wgRequest;
 
                if ( $this->mTitle->exists() && $wgRequest->getBool( 
'wlActionNewItem' ) )
                        return $this->actionNewItem();
@@ -141,9 +141,8 @@
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
                if ( $this->mTitle->exists() ) {
-                       $skin = $wgUser->getSkin();
-                       $wgOut->addHTML( $this->formatWikilogDescription( $skin 
) );
-                       $wgOut->addHTML( $this->formatWikilogInformation( $skin 
) );
+                       $wgOut->addHTML( $this->formatWikilogDescription() );
+                       $wgOut->addHTML( $this->formatWikilogInformation() );
                        if ( $this->mTitle->quickUserCan( 'edit' ) ) {
                                $wgOut->addHTML( $this->formNewItem() );
                        }
@@ -159,20 +158,20 @@
        /**
         * Returns wikilog description as formatted HTML.
         */
-       protected function formatWikilogDescription( $skin ) {
+       protected function formatWikilogDescription() {
                $this->loadWikilogData();
 
                $s = '';
                if ( $this->mWikilogIcon ) {
                        $title = Title::makeTitle( NS_IMAGE, 
$this->mWikilogIcon );
                        $file = wfFindFile( $title );
-                       $s .= $skin->makeImageLink2( $title, $file,
+                       $s .= Linker::makeImageLink2( $title, $file,
                                array( 'align' => 'left' ),
                                array( 'width' => '32' )
                        );
                }
                $s .= Xml::tags( 'div', array( 'class' => 'wl-title' ),
-                       $skin->link( $this->mTitle, null, array(), array(), 
array( 'known', 'noclasses' ) ) );
+                       Linker::link( $this->mTitle, null, array(), array(), 
array( 'known', 'noclasses' ) ) );
 
                $st =& $this->mWikilogSubtitle;
                if ( is_array( $st ) ) {
@@ -188,7 +187,7 @@
        /**
         * Returns wikilog information as formatted HTML.
         */
-       protected function formatWikilogInformation( $skin ) {
+       protected function formatWikilogInformation() {
                $dbr = wfGetDB( DB_SLAVE );
 
                $row = $dbr->selectRow(
@@ -205,10 +204,10 @@
                $n_published = intval( $row->published );
                $n_drafts = $n_total - $n_published;
 
-               $cont = $this->formatPostCount( $skin, 'p', 'published', 
$n_published );
+               $cont = $this->formatPostCount( 'p', 'published', $n_published 
);
                $cont .= Xml::openElement( 'ul' );
-               $cont .= $this->formatPostCount( $skin, 'li', 'drafts', 
$n_drafts );
-               $cont .= $this->formatPostCount( $skin, 'li', 'all', $n_total );
+               $cont .= $this->formatPostCount( 'li', 'drafts', $n_drafts );
+               $cont .= $this->formatPostCount( 'li', 'all', $n_total );
                $cont .= Xml::closeElement( 'ul' );
 
                return Xml::fieldset( wfMsg( 'wikilog-information' ), $cont ) . 
"\n";
@@ -217,11 +216,11 @@
        /**
         * Used by formatWikilogInformation(), formats a post count link.
         */
-       private function formatPostCount( $skin, $elem, $type, $num ) {
+       private function formatPostCount( $elem, $type, $num ) {
                global $wgWikilogFeedClasses;
 
                // Uses messages 'wikilog-post-count-published', 
'wikilog-post-count-drafts', 'wikilog-post-count-all'
-               $s = $skin->link( $this->mTitle,
+               $s = Linker::link( $this->mTitle,
                        wfMsgExt( "wikilog-post-count-{$type}", array( 
'parsemag' ), $num ),
                        array(),
                        array( 'view' => "archives", 'show' => $type ),
@@ -230,7 +229,7 @@
                if ( !empty( $wgWikilogFeedClasses ) ) {
                        $f = array();
                        foreach ( $wgWikilogFeedClasses as $format => $class ) {
-                               $f[] = $skin->link( $this->mTitle,
+                               $f[] = Linker::link( $this->mTitle,
                                        wfMsg( "feed-{$format}" ),
                                        array( 'class' => "feedlink", 'type' => 
"application/{$format}+xml" ),
                                        array( 'view' => "archives", 'show' => 
$type, 'feed' => $format ),
@@ -271,9 +270,7 @@
                global $wgOut, $wgRequest;
 
                if ( !$this->mTitle->quickUserCan( 'edit' ) ) {
-                       $wgOut->loginToUse();
-                       $wgOut->output();
-                       exit;
+                       throw new PermissionsError( 'edit' );
                }
 
                $itemname = $wgRequest->getText( 'wlItemName' );
diff --git a/WikilogParser.php b/WikilogParser.php
index 741c49a..6b82c50 100644
--- a/WikilogParser.php
+++ b/WikilogParser.php
@@ -95,8 +95,6 @@
         * ParserBeforeStrip hook handler function.
         */
        public static function BeforeStrip( &$parser, &$text, &$stripState ) {
-               global $wgUser;
-
                # Do nothing if a title is not set.
                if ( ! ( $title = $parser->getTitle() )  )
                        return true;
@@ -216,7 +214,6 @@
         * {{wl-settings:...}} parser function handler.
         */
        public static function settings( &$parser /* ... */ ) {
-               global $wgOut;
                self::checkNamespace( $parser );
 
                $mwIcon     =& MagicWord::get( 'wlk-icon' );
diff --git a/WlCaptchaAdapter.php b/WlCaptchaAdapter.php
index c095898..43d785a 100644
--- a/WlCaptchaAdapter.php
+++ b/WlCaptchaAdapter.php
@@ -109,7 +109,7 @@
        }
 
        private function shouldCheck( $title, $newText, $oldText = null ) {
-               global $wgUser, $wgCaptchaWhitelistIP, $wgCaptchaRegexes;
+               global $wgUser, $wgRequest, $wgCaptchaWhitelistIP, 
$wgCaptchaRegexes;
                global $wgEmailAuthentication, $ceAllowConfirmedEmail;
 
                if ( $wgUser->isAllowed( 'skipcaptcha' ) ) {
@@ -118,7 +118,7 @@
                }
 
                if ( !empty( $wgCaptchaWhitelistIP ) ) {
-                       $ip = wfGetIp();
+                       $ip = $wgRequest->getIP();
                        foreach ( $wgCaptchaWhitelistIP as $range ) {
                                if ( IP::isInRange( $ip, $range ) ) {
                                        return false;

-- 
To view, visit https://gerrit.wikimedia.org/r/106760
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic799b25fcc2cd1a270eeaad62a754a205e7c45a2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikilog
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to