Index: trunk/extensions/RSS/RSSHooks.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | } |
34 | 34 | |
35 | 35 | if ( count( $wgRSSAllowedFeeds ) && !in_array( $input, $wgRSSAllowedFeeds ) ) { |
36 | | - return wfMsg( 'rss-url-permission ' ); |
| 36 | + return wfMsg( 'rss-url-permission' ); |
37 | 37 | } |
38 | 38 | |
39 | 39 | if ( !Http::isValidURI( $input ) ) { |
Index: branches/wmf/1.17wmf1/extensions/RSS/RSSHooks.php |
— | — | @@ -19,8 +19,12 @@ |
20 | 20 | * @param $frame Frame parser context |
21 | 21 | */ |
22 | 22 | static function renderRss( $input, $args, $parser, $frame ) { |
23 | | - global $wgRSSCacheAge, $wgRSSCacheCompare; |
| 23 | + global $wgRSSCacheAge, $wgRSSCacheCompare, $wgRSSAllowedFeeds; |
24 | 24 | |
| 25 | + if ( count( $wgRSSAllowedFeeds ) && !in_array( $input, $wgRSSAllowedFeeds ) ) { |
| 26 | + return wfMsg( 'rss-url-permission' ); |
| 27 | + } |
| 28 | + |
25 | 29 | if ( !Http::isValidURI( $input ) ) { |
26 | 30 | return wfMsg( 'rss-invalid-url', htmlspecialchars( $input ) ); |
27 | 31 | } |
Index: branches/wmf/1.17wmf1/extensions/RSS/RSS.i18n.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | 'rss-fetch-nourl' => 'Fetch called without a URL!', |
20 | 20 | 'rss-invalid-url' => 'Not a valid URL: $1', |
21 | 21 | 'rss-parse-error' => 'Error parsing XML for RSS', |
| 22 | + 'rss-url-permission' => 'This URL is not allowed to be included', |
22 | 23 | 'rss-item' => '{{RSSPost | title = {{{title}}} | link = {{{link}}} | date = {{{date}}} | author = {{{author}}} }}', |
23 | 24 | ); |
24 | 25 | |
Index: branches/wmf/1.17wmf1/extensions/RSS/RSS.php |
— | — | @@ -56,6 +56,8 @@ |
57 | 57 | // be made. |
58 | 58 | $wgRSSFetchTimeout = 5; // 5 second timeout |
59 | 59 | |
| 60 | +$wgRSSAllowedFeeds = array(); |
| 61 | + |
60 | 62 | // Agent to use for fetching feeds |
61 | 63 | $wgRSSUserAgent = 'MediaWikiRSS/0.01 (+http://www.mediawiki.org/wiki/Extension:RSS) / MediaWiki RSS extension'; |
62 | 64 | |