Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -43,7 +43,9 @@ |
44 | 44 | * @param $htmldiff boolean If set, output using HTMLDiff instead of raw wikicode diff |
45 | 45 | * @param $unhide boolean If set, allow viewing deleted revs |
46 | 46 | */ |
47 | | - function __construct( $titleObj = null, $old = 0, $new = 0, $rcid = 0, $refreshCache = false , $htmldiff = false, $unhide = false ) { |
| 47 | + function __construct( $titleObj = null, $old = 0, $new = 0, $rcid = 0, |
| 48 | + $refreshCache = false, $htmldiff = false, $unhide = false ) |
| 49 | + { |
48 | 50 | $this->mTitle = $titleObj; |
49 | 51 | wfDebug("DifferenceEngine old '$old' new '$new' rcid '$rcid'\n"); |
50 | 52 | |
— | — | @@ -192,12 +194,12 @@ |
193 | 195 | $db = wfGetDB( DB_SLAVE ); |
194 | 196 | $change = RecentChange::newFromConds( |
195 | 197 | array( |
196 | | - // Add redundant user,timestamp condition so we can use the existing index |
197 | | - 'rc_user_text' => $this->mNewRev->getRawUserText(), |
198 | | - 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ), |
199 | | - 'rc_this_oldid' => $this->mNewid, |
200 | | - 'rc_last_oldid' => $this->mOldid, |
201 | | - 'rc_patrolled' => 0 |
| 198 | + // Redundant user,timestamp condition so we can use the existing index |
| 199 | + 'rc_user_text' => $this->mNewRev->getRawUserText(), |
| 200 | + 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ), |
| 201 | + 'rc_this_oldid' => $this->mNewid, |
| 202 | + 'rc_last_oldid' => $this->mOldid, |
| 203 | + 'rc_patrolled' => 0 |
202 | 204 | ), |
203 | 205 | __METHOD__ |
204 | 206 | ); |
— | — | @@ -755,17 +757,21 @@ |
756 | 758 | * Add the header to a diff body |
757 | 759 | */ |
758 | 760 | static function addHeader( $diff, $otitle, $ntitle, $multi = '' ) { |
759 | | - $header = " |
760 | | - <table class='diff'> |
761 | | - <col class='diff-marker' /> |
762 | | - <col class='diff-content' /> |
763 | | - <col class='diff-marker' /> |
764 | | - <col class='diff-content' /> |
| 761 | + $colspan = 1; |
| 762 | + $header = "<table class='diff'>"; |
| 763 | + if( $diff ) { // Safari/Chrome show broken output if cols not used |
| 764 | + $header .= " |
| 765 | + <col class='diff-marker' /> |
| 766 | + <col class='diff-content' /> |
| 767 | + <col class='diff-marker' /> |
| 768 | + <col class='diff-content' />"; |
| 769 | + $colspan = 2; |
| 770 | + } |
| 771 | + $header .= " |
765 | 772 | <tr valign='top'> |
766 | | - <td colspan='2' class='diff-otitle'>{$otitle}</td> |
767 | | - <td colspan='2' class='diff-ntitle'>{$ntitle}</td> |
768 | | - </tr> |
769 | | - "; |
| 773 | + <td colspan='$colspan' class='diff-otitle'>{$otitle}</td> |
| 774 | + <td colspan='$colspan' class='diff-ntitle'>{$ntitle}</td> |
| 775 | + </tr>"; |
770 | 776 | |
771 | 777 | if ( $multi != '' ) |
772 | 778 | $header .= "<tr><td colspan='4' align='center' class='diff-multi'>{$multi}</td></tr>"; |
— | — | @@ -825,7 +831,6 @@ |
826 | 832 | |
827 | 833 | $this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a>"; |
828 | 834 | $this->mNewtitle .= " (<a href='$newEdit'>" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . "</a>)"; |
829 | | - |
830 | 835 | } else { |
831 | 836 | $newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid ); |
832 | 837 | $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mNewid ); |
— | — | @@ -834,10 +839,10 @@ |
835 | 840 | $this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a>"; |
836 | 841 | $this->mNewtitle .= " (<a href='$newEdit'>" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . "</a>)"; |
837 | 842 | } |
838 | | - if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { |
| 843 | + if( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { |
839 | 844 | $this->mNewtitle = "<span class='history-deleted'>{$this->mPagetitle}</span>"; |
840 | 845 | } else if ( $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) { |
841 | | - $this->mNewtitle = '<span class="history-deleted">'.$this->mNewtitle.'</span>'; |
| 846 | + $this->mNewtitle = "<span class='history-deleted'>{$this->mNewtitle}</span>"; |
842 | 847 | } |
843 | 848 | |
844 | 849 | // Load the old revision object |