From: vinithegit Date: Mon, 30 Oct 2017 12:30:37 +0000 (+0530) Subject: Article: Show moveddeleted on 404s for all pages if the user has a session X-Git-Tag: 1.31.0-rc.0~1650^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=7df7fe17276c65e360a944a81748a74b1bd53074;p=lhc%2Fweb%2Fwiklou.git Article: Show moveddeleted on 404s for all pages if the user has a session Add a check for user session and show movedelete message for this case as well. Bug: T178099 Change-Id: Id42f27a19e85b608a734c7fedb4e016d8cdc163e --- diff --git a/includes/page/Article.php b/includes/page/Article.php index 3767ecc141..df189af341 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1179,7 +1179,8 @@ class Article implements Page { $cache = MediaWikiServices::getInstance()->getMainObjectStash(); $key = $cache->makeKey( 'page-recent-delete', md5( $title->getPrefixedText() ) ); $loggedIn = $this->getContext()->getUser()->isLoggedIn(); - if ( $loggedIn || $cache->get( $key ) ) { + $sessionExists = $this->getContext()->getRequest()->getSession()->isPersistent(); + if ( $loggedIn || $cache->get( $key ) || $sessionExists ) { $logTypes = [ 'delete', 'move', 'protect' ]; $dbr = wfGetDB( DB_REPLICA ); @@ -1196,7 +1197,7 @@ class Article implements Page { 'lim' => 10, 'conds' => $conds, 'showIfEmpty' => false, - 'msgKey' => [ $loggedIn + 'msgKey' => [ $loggedIn || $sessionExists ? 'moveddeleted-notice' : 'moveddeleted-notice-recent' ]