Index: trunk/extensions/CentralNotice/BannerLoader.php |
— | — | @@ -4,8 +4,8 @@ |
5 | 5 | * Generates banner HTML files |
6 | 6 | */ |
7 | 7 | class BannerLoader extends UnlistedSpecialPage { |
8 | | - var $project = 'wikipedia'; // Project name |
9 | | - var $language = 'en'; // User language |
| 8 | + public $project = 'wikipedia'; // Project name |
| 9 | + public $language = 'en'; // User language |
10 | 10 | protected $sharedMaxAge = 22; // Cache for ? hours on the server side |
11 | 11 | protected $maxAge = 0; // No client-side banner caching so we get all impressions |
12 | 12 | protected $contentType = 'text/html'; |
— | — | @@ -22,10 +22,10 @@ |
23 | 23 | $this->sendHeaders(); |
24 | 24 | |
25 | 25 | // Get user language from the query string |
26 | | - $this->language = htmlspecialchars( $wgRequest->getText( 'language', 'en' ) ); |
| 26 | + $this->language = $wgRequest->getText( 'language', 'en' ); |
27 | 27 | |
28 | 28 | // Get project name from the query string |
29 | | - $this->project = htmlspecialchars( $wgRequest->getText( 'project', 'wikipedia' ) ); |
| 29 | + $this->project = $wgRequest->getText( 'project', 'wikipedia' ); |
30 | 30 | |
31 | 31 | if ( $wgRequest->getText( 'banner' ) ) { |
32 | 32 | $bannerName = htmlspecialchars( $wgRequest->getText( 'banner' ) ); |
— | — | @@ -146,7 +146,9 @@ |
147 | 147 | $count = intval( $wgMemc->get( 'centralnotice:counter' ) ); |
148 | 148 | if ( !$count ) { |
149 | 149 | // Pull from dynamic counter |
150 | | - $count = intval( @file_get_contents( $wgNoticeCounterSource ) ); |
| 150 | + wfSuppressWarnings(); |
| 151 | + $count = intval( file_get_contents( $wgNoticeCounterSource ) ); |
| 152 | + wfRestoreWarnings(); |
151 | 153 | if ( !$count ) { |
152 | 154 | // Pull long-cached amount |
153 | 155 | $count = intval( $wgMemc->get( 'centralnotice:counter:fallback' ) ); |