Index: trunk/phase3/includes/parser/CoreParserFunctions.php |
— | — | @@ -596,16 +596,19 @@ |
597 | 597 | } |
598 | 598 | |
599 | 599 | /** |
600 | | - * Returns the number of contributions by a certain user |
| 600 | + * Returns the number of contributions by a certain user. This is an |
| 601 | + * expensive parser function and can't be called too many times per page |
601 | 602 | */ |
602 | | - static function numberofcontribs( $parser, $user = null ) { |
603 | | - if ( is_null($user) || !User::isValidUserName( $user ) ) |
| 603 | + static function numberofcontribs( $parser, $user = null, $raw = null ) { |
| 604 | + if ( is_null($user) || !User::isValidUserName( $user ) ) { |
604 | 605 | return ''; |
605 | | - |
| 606 | + } |
| 607 | + if ( !$parser->incrementExpensiveFunctionCount() ) { |
| 608 | + return ''; |
| 609 | + } |
606 | 610 | $u = User::newFromName( $user ); |
607 | 611 | $u->load(); |
608 | | - |
609 | | - return wfEscapeWikiText( $u->edits( $u->mId ) ); |
| 612 | + return self::formatRaw( $u->mEditCount, $raw ); |
610 | 613 | } |
611 | 614 | |
612 | 615 | /** |