Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -524,8 +524,6 @@ |
525 | 525 | } |
526 | 526 | |
527 | 527 | private function renderBucket3( $record ) { |
528 | | - $name = htmlspecialchars( $record[0]->user_name ); |
529 | | - $rating = htmlspecialchars( $record['rating']->aa_response_rating ); |
530 | 528 | $class = $record['rating']->aa_response_rating >= 3 ? 'positive' : 'negative'; |
531 | 529 | |
532 | 530 | return $this->feedbackHead( 'articlefeedbackv5-form3-header', $class, $record[0], $record['rating']->aa_response_rating ) |
— | — | @@ -541,7 +539,6 @@ |
542 | 540 | } |
543 | 541 | |
544 | 542 | private function renderBucket5( $record ) { |
545 | | - $name = htmlspecialchars( $record[0]->user_name ); |
546 | 543 | $body = '<ul>'; |
547 | 544 | $total = 0; |
548 | 545 | $count = 0; |
— | — | @@ -629,12 +626,18 @@ |
630 | 627 | |
631 | 628 | private function feedbackHead( $message, $class, $record, $extra = '' ) { |
632 | 629 | $name = htmlspecialchars( $record->user_name ); |
633 | | - $link = !$record->af_user_ip ? "User:$name" : "Special:Contributions/$name"; |
634 | 630 | $gender = $name; |
| 631 | + if( $record->af_user_ip ) { |
| 632 | + // Anonymous user, go to contributions page. |
| 633 | + $title = SpecialPage::getTitleFor( 'Contributions', $record->user_name ); |
| 634 | + } else { |
| 635 | + // Registered user, go to user page. |
| 636 | + $title = Title::makeTitleSafe( NS_USER, $record->user_name ); |
| 637 | + } |
635 | 638 | |
636 | 639 | return Html::openElement( 'h3', array( 'class' => $class) ) |
637 | 640 | . Html::element( 'span', array( 'class' => 'icon' ) ) |
638 | | - . Linker::link( Title::newFromText( $link ), $name ) |
| 641 | + . Linker::link( $title, $name ) |
639 | 642 | . Html::element( 'span', |
640 | 643 | array( 'class' => 'result' ), |
641 | 644 | wfMessage( $message, $gender, $extra )->text() |