Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1234,10 +1234,13 @@ |
1235 | 1235 | * have query string parameters already. If so, they will be combined. |
1236 | 1236 | * |
1237 | 1237 | * @param string $url |
1238 | | - * @param string $query |
| 1238 | + * @param mixed $query String or associative array |
1239 | 1239 | * @return string |
1240 | 1240 | */ |
1241 | 1241 | function wfAppendQuery( $url, $query ) { |
| 1242 | + if ( is_array( $query ) ) { |
| 1243 | + $query = wfArrayToCGI( $query ); |
| 1244 | + } |
1242 | 1245 | if( $query != '' ) { |
1243 | 1246 | if( false === strpos( $url, '?' ) ) { |
1244 | 1247 | $url .= '?'; |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -553,7 +553,8 @@ |
554 | 554 | $rc->timestamp = $time; |
555 | 555 | $rc->numberofWatchingusers = $baseRC->numberofWatchingusers; |
556 | 556 | |
557 | | - # Make "cur" and "diff" links |
| 557 | + # Make "cur" and "diff" links. Don't use link(), it's too slow if |
| 558 | + # called too many times (50% of CPU time on RecentChanges!). |
558 | 559 | if( $rc->unpatrolled ) { |
559 | 560 | $rcIdQuery = array( 'rcid' => $rc_id ); |
560 | 561 | } else { |
— | — | @@ -564,19 +565,23 @@ |
565 | 566 | $rc_last_oldid ) + $rcIdQuery; |
566 | 567 | $attribs = array( 'tabindex' => $baseRC->counter ); |
567 | 568 | |
568 | | - # Make "diff" and "cur" links |
569 | 569 | if( !$showdifflinks ) { |
570 | 570 | $curLink = $this->message['cur']; |
571 | 571 | $diffLink = $this->message['diff']; |
572 | 572 | } else if( in_array( $rc_type, array(RC_NEW,RC_LOG,RC_MOVE,RC_MOVE_OVER_REDIRECT) ) ) { |
573 | | - $curLink = ($rc_type != RC_NEW) ? $this->message['cur'] |
574 | | - : $this->skin->linkKnown( $rc->getTitle(), $this->message['cur'], $attribs, $querycur ); |
| 573 | + if ( $rc_type != RC_NEW ) { |
| 574 | + $curLink = $this->message['cur']; |
| 575 | + } else { |
| 576 | + $curUrl = wfUrlencode( wfAppendQuery( $rc->getTitle()->getLinkUrl(), $querycur ) ); |
| 577 | + $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>"; |
| 578 | + } |
575 | 579 | $diffLink = $this->message['diff']; |
576 | 580 | } else { |
577 | | - $diffLink = $this->skin->linkKnown( $rc->getTitle(), $this->message['diff'], |
578 | | - $attribs, $querydiff ); |
579 | | - $curLink = $this->skin->linkKnown( $rc->getTitle(), $this->message['cur'], |
580 | | - $attribs, $querycur ); |
| 581 | + $url = $rc->getTitle()->getLinkUrl(); |
| 582 | + $diffUrl = wfUrlencode( wfAppendQuery( $url, $querydiff ) ); |
| 583 | + $curUrl = wfUrlencode( wfAppendQuery( $url, $querycur ) ); |
| 584 | + $diffLink = "<a href=\"$diffUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['diff']}</a>"; |
| 585 | + $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>"; |
581 | 586 | } |
582 | 587 | |
583 | 588 | # Make "last" link |