r42577 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42576‎ | r42577 | r42578 >
Date:21:07, 25 October 2008
Author:brion
Status:old
Tags:
Comment:
Fix regexes in getDisplayName() for ArticlePath cases such as '/techweb/metawiki/$1' -- the 'wiki/' was being incorrectly stripped. We should only strip it when it's a complete path component.
Modified paths:
  • /trunk/extensions/CentralAuth/WikiMap.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/WikiMap.php
@@ -60,8 +60,8 @@
6161 function getDisplayName() {
6262 $url = $this->getUrl( '' );
6363 $url = preg_replace( '!^https?://!', '', $url );
64 - $url = preg_replace( '!index\.php(\?title=|/)$!', '', $url );
65 - $url = preg_replace( '!wiki/$!', '', $url );
 64+ $url = preg_replace( '!/index\.php(\?title=|/)$!', '/', $url );
 65+ $url = preg_replace( '!/wiki/$!', '/', $url );
6666 $url = preg_replace( '!/$!', '', $url );
6767 return $url;
6868 }

Status & tagging log