"Duplicatebug" posted a comment on MediaWiki.r82029.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82029#c29100

Commit summary for MediaWiki.r82029:

* (bug 17160) Gender specific display text for User namespace
Second attempt for this thing..

Duplicatebug's comment:

<pre>
        public function doLinkBatch( $data, $caller = '' ) {
                $default = $this->getDefault();

                $users = array();
                foreach ( $data as $ns => $pagenames ) {
                        if ( !MWNamespace::hasGenderDistinction( $ns ) ) {
                                continue;
                        }
                        foreach ( array_keys( $pagenames ) as $value ) {
                                $username = strtr( $value, '_', ' ' );
                                if ( isset( $this->cache[$username] ) ) {
                                        //already cached
                                        continue;
                                }
                                if ( !User::isValidUserName( $username ) ) {
                                        //invalid username, cache default
                                        $this->cache[$username] = $default;
                                        continue;
                                }
                                $users[$username] = true;
                        }
                }

                $this->doQuery( array_keys( $users ), $caller );
        }
</pre>

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

Reply via email to