Use protocol-relative URL for link to MediaWiki.org (as with the footer logo on each...
[lhc/web/wiklou.git] / includes / Skin.php
index 9d57429..5d0f877 100644 (file)
@@ -183,7 +183,7 @@ abstract class Skin extends ContextSource {
                $titles = array( $user->getUserPage(), $user->getTalkPage() );
 
                // Other tab link
-               if ( $this->getTitle()->getNamespace() == NS_SPECIAL ) {
+               if ( $this->getTitle()->isSpecialPage() ) {
                        // nothing
                } elseif ( $this->getTitle()->isTalkPage() ) {
                        $titles[] = $this->getTitle()->getSubjectPage();
@@ -269,7 +269,7 @@ abstract class Skin extends ContextSource {
                                $this->mRelevantUser = User::newFromName( $rootUser, false );
                        } else {
                                $user = User::newFromName( $rootUser, false );
-                               if ( $user->isLoggedIn() ) {
+                               if ( $user && $user->isLoggedIn() ) {
                                        $this->mRelevantUser = $user;
                                }
                        }
@@ -329,7 +329,7 @@ abstract class Skin extends ContextSource {
        function getPageClasses( $title ) {
                $numeric = 'ns-' . $title->getNamespace();
 
-               if ( $title->getNamespace() == NS_SPECIAL ) {
+               if ( $title->isSpecialPage() ) {
                        $type = 'ns-special';
                        // bug 23315: provide a class based on the canonical special page name without subpages
                        list( $canonicalName ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
@@ -739,7 +739,7 @@ abstract class Skin extends ContextSource {
                $msgObj = $this->msg( $msg )->rawParams( $link );
                if ( $forContent ) {
                        $msg = $msgObj->inContentLanguage()->text();
-                       if ( $this->getLang()->getCode() !== $wgContLang->getCode() ) {
+                       if ( $this->getLanguage()->getCode() !== $wgContLang->getCode() ) {
                                $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $msg );
                        }
                        return $msg;
@@ -782,7 +782,7 @@ abstract class Skin extends ContextSource {
                global $wgStylePath;
 
                $url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
-               $text = '<a href="http://www.mediawiki.org/"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
+               $text = '<a href="//www.mediawiki.org/"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
                wfRunHooks( 'SkinGetPoweredBy', array( &$text, $this ) );
                return $text;
        }
@@ -790,19 +790,19 @@ abstract class Skin extends ContextSource {
        /**
         * Get the timestamp of the latest revision, formatted in user language
         *
-        * @param $article Article object. Used if we're working with the current revision
+        * @param $page WikiPage object. Used if we're working with the current revision
         * @return String
         */
-       protected function lastModified( $article ) {
+       protected function lastModified( $page ) {
                if ( !$this->isRevisionCurrent() ) {
                        $timestamp = Revision::getTimestampFromId( $this->getTitle(), $this->getRevisionId() );
                } else {
-                       $timestamp = $article->getTimestamp();
+                       $timestamp = $page->getTimestamp();
                }
 
                if ( $timestamp ) {
-                       $d = $this->getLang()->userDate( $timestamp, $this->getUser() );
-                       $t = $this->getLang()->userTime( $timestamp, $this->getUser() );
+                       $d = $this->getLanguage()->userDate( $timestamp, $this->getUser() );
+                       $t = $this->getLanguage()->userTime( $timestamp, $this->getUser() );
                        $s = ' ' . $this->msg( 'lastmodifiedat', $d, $t )->text();
                } else {
                        $s = '';
@@ -1061,7 +1061,7 @@ abstract class Skin extends ContextSource {
                global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
                wfProfileIn( __METHOD__ );
 
-               $key = wfMemcKey( 'sidebar', $this->getLang()->getCode() );
+               $key = wfMemcKey( 'sidebar', $this->getLanguage()->getCode() );
 
                if ( $wgEnableSidebarCache ) {
                        $cachedsidebar = $parserMemc->get( $key );