mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS
synced 2024-11-23 23:34:07 +00:00
Fix parsing from CLI; bumped to version 2.23
Removed references to $wgTitle, $wgUser, and $wgLang. Follows-up r113297 and I2d9724314f94c216650370071b31390c5c2c97fc. Bug: 53563 Change-Id: I07fb6939d16a18ecf367ee34ebc176fdc5634dd7
This commit is contained in:
parent
f2948e5bee
commit
8e0763a2cb
|
@ -27,6 +27,10 @@ git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/RSS.git
|
|||
The length limitation must be HTML tag-safe, but it is not at the moment.
|
||||
Length limitation is disabled by default.
|
||||
|
||||
=== Version 2.23 2013-09-03 ===
|
||||
* Fix parsing from CLI:
|
||||
removed references to $wgTitle, $wgUser, and $wgLang.
|
||||
|
||||
=== Version 2.22 2013-06-09 ==
|
||||
* removing white spaces aroung urls in feed item <link> or <id> tags
|
||||
|
||||
|
|
2
RSS.php
2
RSS.php
|
@ -14,7 +14,7 @@
|
|||
* @link http://www.mediawiki.org/wiki/Extension:RSS Documentation
|
||||
*/
|
||||
|
||||
define( "EXTENSION_RSS_VERSION", "2.22" );
|
||||
define( "EXTENSION_RSS_VERSION", "2.23" );
|
||||
|
||||
if ( !defined( 'MEDIAWIKI' ) ) {
|
||||
die( "This is not a valid entry point.\n" );
|
||||
|
|
|
@ -290,11 +290,19 @@ class RSSParser {
|
|||
return $ret;
|
||||
}
|
||||
|
||||
function sandboxParse($wikiText) {
|
||||
global $wgTitle, $wgUser;
|
||||
/**
|
||||
* @see https://bugzilla.wikimedia.org/show_bug.cgi?id=34763
|
||||
* @param string $wikiText
|
||||
* @param Parser $origParser
|
||||
* @return string
|
||||
*/
|
||||
protected function sandboxParse( $wikiText, $origParser ) {
|
||||
$myParser = new Parser();
|
||||
$myParserOptions = ParserOptions::newFromUser($wgUser);
|
||||
$result = $myParser->parse($wikiText, $wgTitle, $myParserOptions);
|
||||
$result = $myParser->parse(
|
||||
$wikiText,
|
||||
$origParser->getTitle(),
|
||||
$origParser->getOptions()
|
||||
);
|
||||
return $result->getText();
|
||||
}
|
||||
|
||||
|
@ -328,7 +336,7 @@ class RSSParser {
|
|||
}
|
||||
}
|
||||
|
||||
$renderedFeed = $this->sandboxParse( $renderedFeed );
|
||||
$renderedFeed = $this->sandboxParse( $renderedFeed, $parser );
|
||||
|
||||
}
|
||||
|
||||
|
@ -376,8 +384,7 @@ class RSSParser {
|
|||
break;
|
||||
default:
|
||||
$str = $this->escapeTemplateParameter( $item[$info] );
|
||||
global $wgLang;
|
||||
$str = $wgLang->truncate( $str, $this->ItemMaxLength );
|
||||
$str = $parser->getFunctionLang()->truncate( $str, $this->ItemMaxLength );
|
||||
$str = $this->highlightTerms( $str );
|
||||
$renderedItem = str_replace( '{{{' . $info . '}}}', $parser->insertStripItem( $str ), $renderedItem );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue