r91775 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91774‎ | r91775 | r91776 >
Date:02:17, 9 July 2011
Author:reedy
Status:ok
Tags:
Comment:
MFT r91774
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/RSS/RSS.i18n.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/RSS/RSS.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/RSS/RSSHooks.php (modified) (history)
  • /trunk/extensions/RSS/RSSHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RSS/RSSHooks.php
@@ -32,7 +32,7 @@
3333 }
3434
3535 if ( count( $wgRSSAllowedFeeds ) && !in_array( $input, $wgRSSAllowedFeeds ) ) {
36 - return wfMsg( 'rss-url-permission ' );
 36+ return wfMsg( 'rss-url-permission' );
3737 }
3838
3939 if ( !Http::isValidURI( $input ) ) {
Index: branches/wmf/1.17wmf1/extensions/RSS/RSSHooks.php
@@ -19,8 +19,12 @@
2020 * @param $frame Frame parser context
2121 */
2222 static function renderRss( $input, $args, $parser, $frame ) {
23 - global $wgRSSCacheAge, $wgRSSCacheCompare;
 23+ global $wgRSSCacheAge, $wgRSSCacheCompare, $wgRSSAllowedFeeds;
2424
 25+ if ( count( $wgRSSAllowedFeeds ) && !in_array( $input, $wgRSSAllowedFeeds ) ) {
 26+ return wfMsg( 'rss-url-permission' );
 27+ }
 28+
2529 if ( !Http::isValidURI( $input ) ) {
2630 return wfMsg( 'rss-invalid-url', htmlspecialchars( $input ) );
2731 }
Index: branches/wmf/1.17wmf1/extensions/RSS/RSS.i18n.php
@@ -18,6 +18,7 @@
1919 'rss-fetch-nourl' => 'Fetch called without a URL!',
2020 'rss-invalid-url' => 'Not a valid URL: $1',
2121 'rss-parse-error' => 'Error parsing XML for RSS',
 22+ 'rss-url-permission' => 'This URL is not allowed to be included',
2223 'rss-item' => '{{RSSPost | title = {{{title}}} | link = {{{link}}} | date = {{{date}}} | author = {{{author}}} }}',
2324 );
2425
Index: branches/wmf/1.17wmf1/extensions/RSS/RSS.php
@@ -56,6 +56,8 @@
5757 // be made.
5858 $wgRSSFetchTimeout = 5; // 5 second timeout
5959
 60+$wgRSSAllowedFeeds = array();
 61+
6062 // Agent to use for fetching feeds
6163 $wgRSSUserAgent = 'MediaWikiRSS/0.01 (+http://www.mediawiki.org/wiki/Extension:RSS) / MediaWiki RSS extension';
6264

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91774* (bug 27768) Make it possible to restrict use of RSS tags...reedy01:59, 9 July 2011

Status & tagging log