Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | $value = nl2br( htmlspecialchars( $value ) ); |
76 | 76 | $value = preg_replace_callback( '/\br(\d+)\b/', array( $this, 'messageRevLink' ), $value ); |
77 | 77 | $value = preg_replace_callback( '/\bbug (\d+)\b/i', array( $this, 'messageBugLink' ), $value ); |
78 | | - return "<code>$value</code>"; |
| 78 | + return $value; |
79 | 79 | } |
80 | 80 | |
81 | 81 | function messageBugLink( $arr ){ |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | $lines = explode( "\n", $message, 2 ); |
102 | 102 | $first = $lines[0]; |
103 | 103 | $trimmed = $wgLang->truncate( $first, 60, '...' ); |
104 | | - return htmlspecialchars( $trimmed ); |
| 104 | + return $this->formatMessage( $trimmed ); |
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
— | — | @@ -214,9 +214,7 @@ |
215 | 215 | $paths = ''; |
216 | 216 | $modifiedPaths = $this->mRev->getModifiedPaths(); |
217 | 217 | foreach( $modifiedPaths as $row ){ |
218 | | - $action = wfMsgHtml( 'code-rev-modified-'.strtolower( $row->cp_action ) ); |
219 | | - $encPath = htmlspecialchars( $row->cp_path ); |
220 | | - $paths .= "<li>$encPath ($action)</li>\n"; |
| 218 | + $paths .= $this->formatPathLine( $row->cp_path, $row->cp_action ); |
221 | 219 | } |
222 | 220 | if( $paths ){ |
223 | 221 | $paths = "<ul>\n$paths</ul>"; |
— | — | @@ -230,4 +228,20 @@ |
231 | 229 | </table>'; |
232 | 230 | $wgOut->addHtml( $html ); |
233 | 231 | } |
| 232 | + |
| 233 | + function formatPathLine( $path, $action ) { |
| 234 | + $desc = wfMsgHtml( 'code-rev-modified-'.strtolower( $action ) ); |
| 235 | + $encPath = htmlspecialchars( $path ); |
| 236 | + $viewvc = $this->mRepo->getViewVcBase(); |
| 237 | + if( $viewvc ) { |
| 238 | + $rev = $this->mRev->getId(); |
| 239 | + $safePath = wfUrlEncode( $path ); |
| 240 | + $link = $this->mSkin->makeExternalLink( |
| 241 | + "$viewvc$safePath?view=markup&pathrev=$rev", |
| 242 | + $encPath ); |
| 243 | + } else { |
| 244 | + $link = $encPath; |
| 245 | + } |
| 246 | + return "<li>$link ($desc)</li>\n"; |
| 247 | + } |
234 | 248 | } |