r88830 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88829‎ | r88830 | r88831 >
Date:20:27, 25 May 2011
Author:yuvipanda
Status:ok
Tags:
Comment:
Fixed shorturls being created for nonexistant pages
Modified paths:
  • /trunk/extensions/ShortUrl/ShortUrl.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ShortUrl/ShortUrl.hooks.php
@@ -22,8 +22,8 @@
2323 */
2424 public static function AddToolboxLink( &$tpl ) {
2525 global $wgOut, $wgShortUrlPrefix;
26 - if ( ! $wgOut->getTitle()->equals( Title::newMainPage() ) ) {
27 - $title = $wgOut->getTitle();
 26+ $title = $wgOut->getTitle();
 27+ if ( $title->exists() && ! $title->equals( Title::newMainPage() ) ) {
2828 $shortId = shorturlEncode( $title );
2929 $shortURL = $wgShortUrlPrefix . $shortId;
3030 $html = Html::rawElement( 'li', array( 'id' => 't-shorturl' ),

Status & tagging log