Fix undefined $ok in DatabaseUpdater::migrateComments
[lhc/web/wiklou.git] / includes / WebRequest.php
index e7c9b83..0a7f416 100644 (file)
@@ -123,9 +123,9 @@ class WebRequest {
                        if ( !preg_match( '!^https?://!', $url ) ) {
                                $url = 'http://unused' . $url;
                        }
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $a = parse_url( $url );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $a ) {
                                $path = isset( $a['path'] ) ? $a['path'] : '';
 
@@ -216,7 +216,7 @@ class WebRequest {
 
                        $host = $parts[0];
                        if ( $wgAssumeProxiesUseDefaultProtocolPorts && isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ) {
-                               // Bug 70021: Assume that upstream proxy is running on the default
+                               // T72021: Assume that upstream proxy is running on the default
                                // port based on the protocol. We have no reliable way to determine
                                // the actual port in use upstream.
                                $port = $stdPort;
@@ -308,7 +308,7 @@ class WebRequest {
         * available variant URLs.
         */
        public function interpolateTitle() {
-               // bug 16019: title interpolation on API queries is useless and sometimes harmful
+               // T18019: title interpolation on API queries is useless and sometimes harmful
                if ( defined( 'MW_API' ) ) {
                        return;
                }
@@ -407,8 +407,8 @@ class WebRequest {
         *
         * @since 1.28
         * @param string $name
-        * @param string|null $default Optional default
-        * @return string
+        * @param string|null $default
+        * @return string|null
         */
        public function getRawVal( $name, $default = null ) {
                $name = strtr( $name, '.', '_' ); // See comment in self::getGPCVal()
@@ -432,7 +432,7 @@ class WebRequest {
         *
         * @param string $name
         * @param string $default Optional default (or null)
-        * @return string
+        * @return string|null
         */
        public function getVal( $name, $default = null ) {
                $val = $this->getGPCVal( $this->data, $name, $default );
@@ -482,7 +482,7 @@ class WebRequest {
         *
         * @param string $name
         * @param array $default Optional default (or null)
-        * @return array
+        * @return array|null
         */
        public function getArray( $name, $default = null ) {
                $val = $this->getGPCVal( $this->data, $name, $default );
@@ -757,22 +757,6 @@ class WebRequest {
                return $this->sessionId;
        }
 
-       /**
-        * Returns true if the request has a persistent session.
-        * This does not necessarily mean that the user is logged in!
-        *
-        * @deprecated since 1.27, use
-        *  \MediaWiki\Session\SessionManager::singleton()->getPersistedSessionId()
-        *  instead.
-        * @return bool
-        */
-       public function checkSessionCookie() {
-               global $wgInitialSessionId;
-               wfDeprecated( __METHOD__, '1.27' );
-               return $wgInitialSessionId !== null &&
-                       $this->getSession()->getId() === (string)$wgInitialSessionId;
-       }
-
        /**
         * Get a cookie from the $_COOKIE jar
         *
@@ -972,7 +956,7 @@ class WebRequest {
        public function response() {
                /* Lazy initialization of response object for this request */
                if ( !is_object( $this->response ) ) {
-                       $class = ( $this instanceof FauxRequest ) ? 'FauxResponse' : 'WebResponse';
+                       $class = ( $this instanceof FauxRequest ) ? FauxResponse::class : WebResponse::class;
                        $this->response = new $class();
                }
                return $this->response;
@@ -1245,7 +1229,7 @@ HTML;
                                if (
                                        IP::isPublic( $ipchain[$i + 1] ) ||
                                        $wgUsePrivateIPs ||
-                                       $proxyLookup->isConfiguredProxy( $curIP ) // bug 48919; treat IP as sane
+                                       $proxyLookup->isConfiguredProxy( $curIP ) // T50919; treat IP as sane
                                ) {
                                        // Follow the next IP according to the proxy
                                        $nextIP = IP::canonicalize( $ipchain[$i + 1] );