jenkins-bot has submitted this change and it was merged.

Change subject: Fix Fatal on various special pages introduced in 1.24.5
......................................................................


Fix Fatal on various special pages introduced in 1.24.5

Bug: T121892
Change-Id: Ie3d23af7a372fa6a5a23cd861a4d34e42fb08195
---
M RELEASE-NOTES-1.24
M includes/MediaWiki.php
M includes/OutputPage.php
M includes/WebRequest.php
4 files changed, 32 insertions(+), 5 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24
index 3dc9761..9000cd5 100644
--- a/RELEASE-NOTES-1.24
+++ b/RELEASE-NOTES-1.24
@@ -1,9 +1,16 @@
 Security reminder: If you have PHP's register_globals option set, you must
 turn it off. MediaWiki will no longer work with it enabled.
 
+== MediaWiki 1.24.6 ==
+
+THIS IS NOT A RELEASE YET!
+
+== Changes since 1.24.5 ==
+* (T121892) Fix fatal error on some Special pages, introduced in 1.24.5.
+
 == MediaWiki 1.24.5 ==
 
-This is a security and maintenance release of the MediaWiki 1.23 branch.
+This is a security and maintenance release of the MediaWiki 1.24 branch.
 
 == Changes since 1.24.4 ==
 * (T117899) SECURITY: $wgArticlePath can no longer be set to relative paths
diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index b828ad3..b703a4f 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -158,7 +158,7 @@
         * @return void
         */
        private function performRequest() {
-               global $wgTitle;
+               global $wgTitle, $wgHideIdentifiableRedirects;
 
                wfProfileIn( __METHOD__ );
 
@@ -237,7 +237,7 @@
                        if ( $title->isSpecialPage() ) {
                                $specialPage = SpecialPageFactory::getPage( 
$title->getDBKey() );
                                if ( $specialPage instanceof RedirectSpecialPage
-                                       && $this->config->get( 
'HideIdentifiableRedirects' )
+                                       && $wgHideIdentifiableRedirects
                                        && 
$specialPage->personallyIdentifiableTarget()
                                ) {
                                        list( , $subpage ) = 
SpecialPageFactory::resolveAlias( $title->getDBKey() );
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 55b1da0..df417b0 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -242,6 +242,8 @@
 
        /** @var int Cache stuff. Looks like mEnableClientCache */
        protected $mSquidMaxage = 0;
+       /** @var int Upper limit on mSquidMaxage */
+       protected $mCdnMaxageLimit = INF;
 
        /**
         * @var bool
@@ -1846,7 +1848,17 @@
         * @param int $maxage Maximum cache time on the Squid, in seconds.
         */
        public function setSquidMaxage( $maxage ) {
-               $this->mSquidMaxage = $maxage;
+               $this->mSquidMaxage = min( $maxage, $this->mCdnMaxageLimit );
+       }
+
+       /**
+        * Lower the value of the "s-maxage" part of the "Cache-control" HTTP 
header
+        *
+        * @param int $maxage Maximum cache time on the CDN, in seconds
+        */
+       public function lowerCdnMaxage( $maxage ) {
+               $this->mCdnMaxageLimit = min( $maxage, $this->mCdnMaxageLimit );
+               $this->setSquidMaxage( $this->mSquidMaxage );
        }
 
        /**
diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index b187c4a..1cbdbf9 100644
--- a/includes/WebRequest.php
+++ b/includes/WebRequest.php
@@ -1255,6 +1255,7 @@
 class FauxRequest extends WebRequest {
        private $wasPosted = false;
        private $session = array();
+       private $requestUrl;
 
        /**
         * @param array $data Array of *non*-urlencoded key => value pairs, the
@@ -1334,8 +1335,15 @@
                return false;
        }
 
+       public function setRequestURL( $url ) {
+               $this->requestUrl = $url;
+       }
+
        public function getRequestURL() {
-               $this->notImplemented( __METHOD__ );
+               if ( $this->requestUrl === null ) {
+                       throw new MWException( 'Request URL not set' );
+               }
+               return $this->requestUrl;
        }
 
        public function getProtocol() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3d23af7a372fa6a5a23cd861a4d34e42fb08195
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_24
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to