2010-07-22 22:07:15 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2010-07-23 15:26:27 +00:00
|
|
|
* RSS-Feed MediaWiki extension
|
2010-07-23 14:14:05 +00:00
|
|
|
*
|
2010-07-23 15:26:27 +00:00
|
|
|
* @file
|
2010-07-23 14:01:46 +00:00
|
|
|
* @ingroup Extensions
|
2012-02-27 01:10:57 +00:00
|
|
|
* @version 2.10
|
2011-08-15 21:52:08 +00:00
|
|
|
* @author mutante, Daniel Kinzler, Rdb, Mafs, Thomas Gries, Alxndr, Chris Reigrut, K001
|
2010-07-23 15:26:27 +00:00
|
|
|
* @author Kellan Elliott-McCrea <kellan@protest.net> -- author of MagpieRSS
|
|
|
|
* @author Jeroen De Dauw
|
|
|
|
* @author Jack Phoenix <jack@countervandalism.net>
|
|
|
|
* @copyright © Kellan Elliott-McCrea <kellan@protest.net>
|
2011-08-15 21:52:08 +00:00
|
|
|
* @copyright © mutante, Daniel Kinzler, Rdb, Mafs, Thomas Gries, Alxndr, Chris Reigrut, K001
|
2010-07-23 15:26:27 +00:00
|
|
|
* @link http://www.mediawiki.org/wiki/Extension:RSS Documentation
|
2010-07-22 22:07:15 +00:00
|
|
|
*/
|
2010-07-23 14:14:05 +00:00
|
|
|
|
2012-02-27 01:10:57 +00:00
|
|
|
define( "EXTENSION_RSS_VERSION", "2.10 20120227" );
|
2012-02-23 21:12:54 +00:00
|
|
|
|
2010-10-20 18:28:47 +00:00
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
2010-07-22 22:07:15 +00:00
|
|
|
die( "This is not a valid entry point.\n" );
|
|
|
|
}
|
2010-07-23 14:14:05 +00:00
|
|
|
|
2010-07-23 15:26:27 +00:00
|
|
|
// Extension credits that will show up on Special:Version
|
2010-07-22 22:07:15 +00:00
|
|
|
$wgExtensionCredits['parserhook'][] = array(
|
2011-08-31 14:32:50 +00:00
|
|
|
'path' => __FILE__,
|
2010-07-22 22:07:15 +00:00
|
|
|
'name' => 'RSS feed',
|
2011-08-15 21:52:08 +00:00
|
|
|
'author' => array( 'Kellan Elliott-McCrea', 'mutante', 'Daniel Kinzler',
|
|
|
|
'Rdb', 'Mafs', 'Alxndr', 'Thomas Gries', 'Chris Reigrut',
|
|
|
|
'K001', 'Jack Phoenix', 'Jeroen De Dauw', 'Mark A. Hershberger'
|
2010-07-23 14:01:46 +00:00
|
|
|
),
|
2012-02-23 21:12:54 +00:00
|
|
|
'version' => EXTENSION_RSS_VERSION,
|
2011-12-13 23:49:33 +00:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:RSS',
|
2010-07-23 08:02:27 +00:00
|
|
|
'descriptionmsg' => 'rss-desc',
|
2010-07-22 22:07:15 +00:00
|
|
|
);
|
2010-07-23 14:14:05 +00:00
|
|
|
|
2010-07-23 15:26:27 +00:00
|
|
|
// Internationalization file and autoloadable classes
|
|
|
|
$dir = dirname( __FILE__ ) . '/';
|
|
|
|
$wgExtensionMessagesFiles['RSS'] = $dir . 'RSS.i18n.php';
|
2010-11-04 23:19:00 +00:00
|
|
|
$wgAutoloadClasses['RSSHooks'] = $dir . 'RSSHooks.php';
|
|
|
|
$wgAutoloadClasses['RSSParser'] = $dir . 'RSSParser.php';
|
2012-02-23 21:12:54 +00:00
|
|
|
$wgAutoloadClasses['RSSUtils'] = $dir . 'RSSParser.php';
|
2010-10-19 21:54:53 +00:00
|
|
|
$wgAutoloadClasses['RSSData'] = $dir . 'RSSData.php';
|
2010-07-23 08:02:27 +00:00
|
|
|
|
2010-11-04 23:19:00 +00:00
|
|
|
$wgHooks['ParserFirstCallInit'][] = 'RSSHooks::parserInit';
|
2010-11-01 16:25:04 +00:00
|
|
|
|
2012-02-23 21:12:54 +00:00
|
|
|
// one hour
|
|
|
|
$wgRSSCacheAge = 3600;
|
2010-11-05 00:59:28 +00:00
|
|
|
|
2011-08-15 21:52:08 +00:00
|
|
|
// Check cached content, if available, against remote.
|
|
|
|
// $wgRSSCacheCompare should be set to false or a timeout
|
|
|
|
// (less than $wgRSSCacheAge) after which a comparison will be made.
|
2012-02-24 10:16:34 +00:00
|
|
|
// for debugging set $wgRSSCacheCompare = 1;
|
2011-08-15 21:52:08 +00:00
|
|
|
$wgRSSCacheCompare = false;
|
|
|
|
|
2012-02-27 01:10:57 +00:00
|
|
|
// 15 second timeout
|
2012-02-23 22:24:00 +00:00
|
|
|
$wgRSSFetchTimeout = 15;
|
2011-08-15 21:52:08 +00:00
|
|
|
|
|
|
|
// Ignore the RSS tag in all but the namespaces listed here.
|
|
|
|
// null (the default) means the <rss> tag can be used anywhere.
|
|
|
|
$wgRSSNamespaces = null;
|
|
|
|
|
2012-02-23 21:12:54 +00:00
|
|
|
// Whitelist of allowed RSS Urls
|
|
|
|
//
|
|
|
|
// If there are items in the array, and the user supplied URL is not in the array,
|
|
|
|
// the url will not be allowed
|
|
|
|
//
|
|
|
|
// Urls are case-sensitively tested against values in the array.
|
|
|
|
// They must exactly match including any trailing "/" character.
|
|
|
|
//
|
|
|
|
// Warning: Allowing all urls (not setting a whitelist)
|
|
|
|
// may be a security concern.
|
|
|
|
//
|
|
|
|
// an empty or non-existent array means: no whitelist defined
|
|
|
|
// this is the default: an empty whitelist. No servers are allowed by default.
|
|
|
|
$wgRSSUrlWhitelist = array();
|
|
|
|
|
|
|
|
// include "*" if you expressly want to allow all urls (you should not do this)
|
|
|
|
// $wgRSSUrlWhitelist = array( "*" );
|
2011-07-09 01:59:02 +00:00
|
|
|
|
2012-02-27 01:10:57 +00:00
|
|
|
// Maximum number of redirects to follow (defaults to 0)
|
|
|
|
// Note: this should only be used when the target URLs are trusted,
|
|
|
|
// to avoid attacks on intranet services accessible by HTTP.
|
|
|
|
$wgRSSUrlNumberOfAllowedRedirects = 0;
|
|
|
|
|
2010-11-05 00:59:28 +00:00
|
|
|
// Agent to use for fetching feeds
|
2012-02-23 21:12:54 +00:00
|
|
|
$wgRSSUserAgent = "MediaWikiRSS/" . strtok( EXTENSION_RSS_VERSION, " " ) . " (+http://www.mediawiki.org/wiki/Extension:RSS) / MediaWiki RSS extension";
|
2010-11-25 12:38:25 +00:00
|
|
|
|
|
|
|
// Proxy server to use for fetching feeds
|
2011-07-09 01:59:02 +00:00
|
|
|
$wgRSSProxy = false;
|
2012-02-13 01:39:24 +00:00
|
|
|
|
|
|
|
// default date format of item publication dates see http://www.php.net/date
|
|
|
|
$wgRSSDateDefaultFormat = "(Y-m-d H:i:s)";
|
2012-02-13 07:23:56 +00:00
|
|
|
|
|
|
|
// limit the number of characters in the item description
|
|
|
|
// or set to false for unlimited length.
|
2012-02-13 07:36:01 +00:00
|
|
|
// $wgRSSItemMaxLength = false;
|
2012-02-27 01:10:57 +00:00
|
|
|
$wgRSSItemMaxLength = 200;
|