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

Revision: 97475
Author:   nikerabbit
Date:     2011-09-19 11:49:22 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
Fixing bug 30973. Strip off subpages when determining the username who the 
current page belongs to.

Modified Paths:
--------------
    trunk/phase3/includes/Title.php

Modified: trunk/phase3/includes/Title.php
===================================================================
--- trunk/phase3/includes/Title.php     2011-09-19 11:47:12 UTC (rev 97474)
+++ trunk/phase3/includes/Title.php     2011-09-19 11:49:22 UTC (rev 97475)
@@ -639,9 +639,17 @@
                        }
                }
 
+               // Strip off subpages
+               $pagename = $this->getText();
+               if ( strpos( $pagename, '/' ) !== false ) {
+                       list( $username , ) = explode( '/', $pagename, 2 );
+               } else {
+                       $username = $pagename;
+               }
+
                if ( $wgContLang->needsGenderDistinction() &&
                                MWNamespace::hasGenderDistinction( 
$this->mNamespace ) ) {
-                       $gender = GenderCache::singleton()->getGenderOf( 
$this->getText(), __METHOD__ );
+                       $gender = GenderCache::singleton()->getGenderOf( 
$username, __METHOD__ );
                        return $wgContLang->getGenderNsText( $this->mNamespace, 
$gender );
                }
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to