E_STRICT minor tweaks:
authorNick Jenkins <nickj@users.mediawiki.org>
Mon, 4 Dec 2006 11:28:48 +0000 (11:28 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Mon, 4 Dec 2006 11:28:48 +0000 (11:28 +0000)
* Strict Standards: Undefined index:  currevisionid in includes/Skin.php on line 287
* Strict Standards: Undefined index:  oldid in includes/Skin.php on line 288
[ Repo above with error_logging(E_ALL | E_STRICT) in LocalSettings.php, and a non-default skin, e.g: http://localhost/wiki/index.php?title=Main_Page&useskin=nostalgia ]
* Strict Standards: is_a(): Deprecated. Please use the instanceof operator in includes/UserMailer.php on line 42

includes/Skin.php
includes/UserMailer.php

index ab695df..45e8f28 100644 (file)
@@ -300,7 +300,7 @@ class Skin extends Linker {
        function getHeadScripts() {
                global $wgStylePath, $wgUser, $wgAllowUserJs, $wgJsMimeType, $wgStyleVersion;
                global $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang, $wgLang;
-               global $wgTitle, $wgCanonicalNamespaceNames, $wgOut;
+               global $wgTitle, $wgCanonicalNamespaceNames, $wgOut, $wgArticle, $wgRequest;
 
                $ns = $wgTitle->getNamespace();
                $nsname = isset( $wgCanonicalNamespaceNames[ $ns ] ) ? $wgCanonicalNamespaceNames[ $ns ] : $wgTitle->getNsText();
@@ -317,6 +317,8 @@ class Skin extends Linker {
                        'titleprefixeddbkey' => $wgTitle->getPrefixedDBKey(),
                        'titletext' => $wgTitle->getText(),
                        'articleid' => $wgTitle->getArticleId(),
+                       'currevisionid' => isset( $wgArticle ) ? $wgArticle->getLatest() : 0,
+                       'oldid' => $wgRequest->getVal( 'oldid' ),
                        'isarticle' => $wgOut->isArticle(),
                        'username' => $wgUser->isAnon() ? NULL : $wgUser->getName(),
                        'userlang' => $wgLang->getCode(),
index a982439..0101f74 100644 (file)
@@ -39,7 +39,7 @@ class MailAddress {
         * @param string $name Human-readable name if a string address is given
         */
        function MailAddress( $address, $name=null ) {
-               if( is_object( $address ) && is_a( $address, 'User' ) ) {
+               if( is_object( $address ) && $address instanceof User ) {
                        $this->address = $address->getEmail();
                        $this->name = $address->getName();
                } else {