Fix 2536 : 'Related Changes' being shown on non existent pages
authorAntoine Musso <hashar@users.mediawiki.org>
Sun, 11 Dec 2005 19:10:53 +0000 (19:10 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sun, 11 Dec 2005 19:10:53 +0000 (19:10 +0000)
includes/SkinTemplate.php
skins/MonoBook.php

index 834d9f7..f0d5423 100644 (file)
@@ -841,9 +841,11 @@ class SkinTemplate extends Skin {
                        $nav_urls['whatlinkshere'] = array(
                                'href' => $this->makeSpecialUrl("Whatlinkshere/$this->thispage")
                        );
-                       $nav_urls['recentchangeslinked'] = array(
-                               'href' => $this->makeSpecialUrl("Recentchangeslinked/$this->thispage")
-                       );
+                       if( $this->mTitle->getArticleId() ) {
+                               $nav_urls['recentchangeslinked'] = array(
+                                       'href' => $this->makeSpecialUrl("Recentchangeslinked/$this->thispage")
+                               );
+                       }
                        if ($wgUseTrackbacks)
                                $nav_urls['trackbacklink'] = array(
                                        'href' => $wgTitle->trackbackURL()
index 42aaa9c..d119577 100644 (file)
@@ -160,10 +160,14 @@ class MonoBookTemplate extends QuickTemplate {
                <h5><?php $this->msg('toolbox') ?></h5>
                <div class="pBody">
                        <ul>
-                       <?php if($this->data['notspecialpage']) { foreach( array( 'whatlinkshere', 'recentchangeslinked' ) as $special ) { ?>
-                       <li id="t-<?php echo $special?>"><a href="<?php
-                               echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
-                               ?>"><?php echo $this->msg($special) ?></a></li>
+                       <?php if($this->data['notspecialpage']) { ?>
+                       <li id="t-whatlinkshere"><a href="<?php
+                               echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
+                               ?>"><?php echo $this->msg('whatlinkshere') ?></a></li>
+                       <?php if( $this->data['nav_urls']['recentchangeslinked'] ) { ?>
+                       <li id="t-recentchangeslinked"><a href="<?php
+                               echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
+                               ?>"><?php echo $this->msg('recentchangeslinked') ?></a></li>
                        <?php } } ?>
                                                        <?php if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
                        <li id="t-trackbacklink"><a href="<?php