Index: trunk/extensions/CodeReview/ui/CodeView.php |
— | — | @@ -14,6 +14,11 @@ |
15 | 15 | */ |
16 | 16 | var $skin; |
17 | 17 | |
| 18 | + /** |
| 19 | + * @var CodeCommentLinkerHtml |
| 20 | + */ |
| 21 | + var $codeCommentLinker; |
| 22 | + |
18 | 23 | function __construct( $repo ) { |
19 | 24 | $this->mRepo = ( $repo instanceof CodeRepository ) |
20 | 25 | ? $repo |
— | — | @@ -21,6 +26,8 @@ |
22 | 27 | |
23 | 28 | global $wgUser; |
24 | 29 | $this->skin = $wgUser->getSkin(); |
| 30 | + |
| 31 | + $this->codeCommentLinker = new CodeCommentLinkerHtml( $repo ); |
25 | 32 | } |
26 | 33 | |
27 | 34 | function validPost( $permission ) { |
— | — | @@ -44,8 +51,7 @@ |
45 | 52 | |
46 | 53 | function formatMessage( $text ) { |
47 | 54 | $text = nl2br( htmlspecialchars( $text ) ); |
48 | | - $linker = new CodeCommentLinkerHtml( $this->mRepo ); |
49 | | - return $linker->link( $text ); |
| 55 | + return $this->codeCommentLinker->link( $text ); |
50 | 56 | } |
51 | 57 | |
52 | 58 | function messageFragment( $value ) { |