Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -616,29 +616,24 @@ |
617 | 617 | public function getIRCLine() { |
618 | 618 | global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki; |
619 | 619 | |
620 | | - // FIXME: Would be good to replace these 2 extract() calls with something more explicit |
621 | | - // e.g. list ($rc_type, $rc_id) = array_values ($this->mAttribs); [or something like that] |
622 | | - extract($this->mAttribs); |
623 | | - extract($this->mExtra); |
624 | | - |
625 | | - if( $rc_type == RC_LOG ) { |
626 | | - $titleObj = Title::newFromText( "Log/$rc_log_type", NS_SPECIAL ); |
| 620 | + if( $this->mAttribs['rc_type'] == RC_LOG ) { |
| 621 | + $titleObj = Title::newFromText( 'Log/' . $this->mAttribs['rc_log_type'], NS_SPECIAL ); |
627 | 622 | } else { |
628 | 623 | $titleObj =& $this->getTitle(); |
629 | 624 | } |
630 | 625 | $title = $titleObj->getPrefixedText(); |
631 | 626 | $title = self::cleanupForIRC( $title ); |
632 | 627 | |
633 | | - if( $rc_type == RC_LOG ) { |
| 628 | + if( $this->mAttribs['rc_type'] == RC_LOG ) { |
634 | 629 | $url = ''; |
635 | 630 | } else { |
636 | | - if( $rc_type == RC_NEW ) { |
637 | | - $url = "oldid=$rc_this_oldid"; |
| 631 | + if( $this->mAttribs['rc_type'] == RC_NEW ) { |
| 632 | + $url = 'oldid=' . $this->mAttribs['rc_this_oldid']; |
638 | 633 | } else { |
639 | | - $url = "diff=$rc_this_oldid&oldid=$rc_last_oldid"; |
| 634 | + $url = 'diff=' . $this->mAttribs['rc_this_oldid'] . '&oldid=' . $this->mAttribs['rc_last_oldid']; |
640 | 635 | } |
641 | | - if( $wgUseRCPatrol || ($rc_type == RC_NEW && $wgUseNPPatrol) ) { |
642 | | - $url .= "&rcid=$rc_id"; |
| 636 | + if ( $wgUseRCPatrol || ( $this->mAttribs['rc_type'] == RC_NEW && $wgUseNPPatrol ) ) { |
| 637 | + $url .= '&rcid=' . $this->mAttribs['rc_id']; |
643 | 638 | } |
644 | 639 | // XXX: *HACK* this should use getFullURL(), hacked for SSL madness --brion 2005-12-26 |
645 | 640 | // XXX: *HACK^2* the preg_replace() undoes much of what getInternalURL() does, but we |
— | — | @@ -647,8 +642,8 @@ |
648 | 643 | $url = preg_replace( '/title=[^&]*&/', '', $titleObj->getInternalURL( $url ) ); |
649 | 644 | } |
650 | 645 | |
651 | | - if( isset( $oldSize ) && isset( $newSize ) ) { |
652 | | - $szdiff = $newSize - $oldSize; |
| 646 | + if( isset( $this->mExtra['oldSize'] ) && isset( $this->mExtra['newSize'] ) ) { |
| 647 | + $szdiff = $this->mExtra['newSize'] - $this->mExtra['oldSize']; |
653 | 648 | if($szdiff < -500) { |
654 | 649 | $szdiff = "\002$szdiff\002"; |
655 | 650 | } elseif($szdiff >= 0) { |
— | — | @@ -659,19 +654,19 @@ |
660 | 655 | $szdiff = ''; |
661 | 656 | } |
662 | 657 | |
663 | | - $user = self::cleanupForIRC( $rc_user_text ); |
| 658 | + $user = self::cleanupForIRC( $this->mAttribs['rc_user_text'] ); |
664 | 659 | |
665 | | - if( $rc_type == RC_LOG ) { |
| 660 | + if ( $this->mAttribs['rc_type'] == RC_LOG ) { |
666 | 661 | $targetText = $this->getTitle()->getPrefixedText(); |
667 | | - $comment = self::cleanupForIRC( str_replace("[[$targetText]]","[[\00302$targetText\00310]]",$actionComment) ); |
668 | | - $flag = $rc_log_action; |
| 662 | + $comment = self::cleanupForIRC( str_replace( "[[$targetText]]", "[[\00302$targetText\00310]]", $this->mExtra['actionComment'] ) ); |
| 663 | + $flag = $this->mAttribs['rc_log_action']; |
669 | 664 | } else { |
670 | | - $comment = self::cleanupForIRC( $rc_comment ); |
| 665 | + $comment = self::cleanupForIRC( $this->mAttribs['rc_comment'] ); |
671 | 666 | $flag = ''; |
672 | | - if( !$rc_patrolled && ($wgUseRCPatrol || $rc_new && $wgUseNPPatrol) ) { |
| 667 | + if ( !$this->mAttribs['rc_patrolled'] && ( $wgUseRCPatrol || $this->mAttribs['rc_new'] && $wgUseNPPatrol ) ) { |
673 | 668 | $flag .= '!'; |
674 | 669 | } |
675 | | - $flag .= ($rc_new ? "N" : "") . ($rc_minor ? "M" : "") . ($rc_bot ? "B" : ""); |
| 670 | + $flag .= ( $this->mAttribs['rc_new'] ? "N" : "" ) . ( $this->mAttribs['rc_minor'] ? "M" : "" ) . ( $this->mAttribs['rc_bot'] ? "B" : "" ); |
676 | 671 | } |
677 | 672 | |
678 | 673 | if ( $wgRC2UDPInterwikiPrefix === true && $wgLocalInterwiki !== false ) { |