Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewDiff.php |
— | — | @@ -11,8 +11,7 @@ |
12 | 12 | function show() { |
13 | 13 | $show = $this->loadData(); |
14 | 14 | |
15 | | - global $wgOut, $wgUser, $wgLang; |
16 | | - $this->mSkin = $wgUser->getSkin(); |
| 15 | + global $wgOut, $wgLang; |
17 | 16 | |
18 | 17 | $links = array(); |
19 | 18 | if ( $this->mFilter ) { |
— | — | @@ -21,7 +20,7 @@ |
22 | 21 | } |
23 | 22 | |
24 | 23 | foreach ( $links as $msg => $title ) { |
25 | | - $links[$msg] = $this->mSkin->link( $title, wfMsgExt( $msg, 'parseinline' ) ); |
| 24 | + $links[$msg] = Linker::link( $title, wfMsgExt( $msg, 'parseinline' ) ); |
26 | 25 | } |
27 | 26 | |
28 | 27 | $backlinks = $wgLang->pipeList( $links ); |
— | — | @@ -33,10 +32,18 @@ |
34 | 33 | } |
35 | 34 | |
36 | 35 | function loadData() { |
| 36 | + global $wgUser; |
37 | 37 | $oldSpec = $this->mParams[3]; |
38 | 38 | $newSpec = $this->mParams[4]; |
39 | 39 | $this->mFilter = $this->mParams[1]; |
40 | 40 | |
| 41 | + if ( AbuseFilter::filterHidden( $this->mFilter ) && |
| 42 | + !$wgUser->isAllowed( 'abusefilter-modify' ) ) { |
| 43 | + global $wgOut; |
| 44 | + $wgOut->addWikiMsg( 'abusefilter-history-error-hidden' ); |
| 45 | + return false; |
| 46 | + } |
| 47 | + |
41 | 48 | $this->mOldVersion = $this->loadSpec( $oldSpec, $newSpec ); |
42 | 49 | $this->mNewVersion = $this->loadSpec( $newSpec, $oldSpec ); |
43 | 50 | |
— | — | @@ -53,13 +60,6 @@ |
54 | 61 | static $dependentSpecs = array( 'prev', 'next' ); |
55 | 62 | static $cache = array(); |
56 | 63 | |
57 | | - global $wgUser; |
58 | | - |
59 | | - if ( AbuseFilter::filterHidden( $this->mFilter ) && |
60 | | - !$wgUser->isAllowed( 'abusefilter-modify' ) ) { |
61 | | - return null; |
62 | | - } |
63 | | - |
64 | 64 | if ( isset( $cache[$spec] ) ) |
65 | 65 | return $cache[$spec]; |
66 | 66 | |
— | — | @@ -153,15 +153,13 @@ |
154 | 154 | } |
155 | 155 | |
156 | 156 | function formatVersionLink( $timestamp, $history_id ) { |
157 | | - global $wgLang, $wgUser; |
| 157 | + global $wgLang; |
158 | 158 | |
159 | | - $sk = $wgUser->getSkin(); |
160 | | - |
161 | 159 | $filter = $this->mFilter; |
162 | 160 | $text = $wgLang->timeanddate( $timestamp, true ); |
163 | 161 | $title = $this->getTitle( "history/$filter/item/$history_id" ); |
164 | 162 | |
165 | | - $link = $sk->link( $title, $text ); |
| 163 | + $link = Linker::link( $title, $text ); |
166 | 164 | |
167 | 165 | return $link; |
168 | 166 | } |
— | — | @@ -180,12 +178,11 @@ |
181 | 179 | $newVersion['meta']['history_id'] |
182 | 180 | ); |
183 | 181 | |
184 | | - $sk = $this->mSkin; |
185 | | - $oldUserLink = $sk->userLink( |
| 182 | + $oldUserLink = Linker::userLink( |
186 | 183 | $oldVersion['meta']['modified_by'], |
187 | 184 | $oldVersion['meta']['modified_by_text'] |
188 | 185 | ); |
189 | | - $newUserLink = $sk->userLink( |
| 186 | + $newUserLink = Linker::userLink( |
190 | 187 | $newVersion['meta']['modified_by'], |
191 | 188 | $newVersion['meta']['modified_by_text'] |
192 | 189 | ); |