http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88830

Revision: 88830
Author:   yuvipanda
Date:     2011-05-25 20:27:04 +0000 (Wed, 25 May 2011)
Log Message:
-----------
Fixed shorturls being created for nonexistant pages

Modified Paths:
--------------
    trunk/extensions/ShortUrl/ShortUrl.hooks.php

Modified: trunk/extensions/ShortUrl/ShortUrl.hooks.php
===================================================================
--- trunk/extensions/ShortUrl/ShortUrl.hooks.php        2011-05-25 20:19:18 UTC 
(rev 88829)
+++ trunk/extensions/ShortUrl/ShortUrl.hooks.php        2011-05-25 20:27:04 UTC 
(rev 88830)
@@ -22,8 +22,8 @@
         */
        public static function AddToolboxLink( &$tpl ) {
                global $wgOut, $wgShortUrlPrefix;
-               if ( ! $wgOut->getTitle()->equals( Title::newMainPage() ) ) {
-                       $title = $wgOut->getTitle();
+               $title = $wgOut->getTitle();
+               if ( $title->exists() && ! $title->equals( Title::newMainPage() 
) ) {
                        $shortId = shorturlEncode( $title );
                        $shortURL = $wgShortUrlPrefix . $shortId;
                        $html = Html::rawElement( 'li', array( 'id' => 
't-shorturl' ),


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to