Move callers away from Title::GAID_FOR_UPDATE
[lhc/web/wiklou.git] / includes / actions / MarkpatrolledAction.php
index 8df6044..431ea06 100644 (file)
@@ -20,6 +20,8 @@
  * @ingroup Actions
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Mark a revision as patrolled on a page
  *
@@ -40,6 +42,10 @@ class MarkpatrolledAction extends FormAction {
                return 'patrol';
        }
 
+       protected function usesOOUI() {
+               return true;
+       }
+
        protected function getRecentChange( $data = null ) {
                $rc = null;
                // Note: This works both on initial GET url and after submitting the form
@@ -56,6 +62,7 @@ class MarkpatrolledAction extends FormAction {
        protected function preText() {
                $rc = $this->getRecentChange();
                $title = $rc->getTitle();
+               $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
 
                // Based on logentry-patrol-patrol (see PatrolLogFormatter)
                $revId = $rc->getAttribute( 'rc_this_oldid' );
@@ -64,8 +71,8 @@ class MarkpatrolledAction extends FormAction {
                        'diff' => $revId,
                        'oldid' => $rc->getAttribute( 'rc_last_oldid' )
                ];
-               $revlink = Linker::link( $title, htmlspecialchars( $revId ), [], $query );
-               $pagelink = Linker::link( $title, htmlspecialchars( $title->getPrefixedText() ) );
+               $revlink = $linkRenderer->makeLink( $title, $revId, [], $query );
+               $pagelink = $linkRenderer->makeLink( $title, $title->getPrefixedText() );
 
                return $this->msg( 'confirm-markpatrolled-top' )->params(
                        $title->getPrefixedText(),
@@ -82,6 +89,7 @@ class MarkpatrolledAction extends FormAction {
        }
 
        /**
+        * @param array $data
         * @return bool|array True for success, false for didn't-try, array of errors on failure
         */
        public function onSubmit( $data ) {