Wikinaut has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/50888


Change subject: (bug 45387) (bug 45388) $wgRSSAllowImageTag new name; bug fixed
......................................................................

(bug 45387) (bug 45388) $wgRSSAllowImageTag new name; bug fixed

+++ breaking change +++
variable name $wgAllowImageTag renamed to $wgRSSAllowImagetag

+ fixed a problem that $wgAllowImageTag was not obeyed
+ added $wgRSSAllowImageTag to the variable declaration list in RSS.php

Change-Id: I112ebcdf492dfe80ba187fe6ab2406d3eed10f6a
---
M RELEASE-NOTES
M RSS.php
M RSSParser.php
3 files changed, 27 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RSS 
refs/changes/88/50888/1

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 89c430d..915c392 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,6 +1,6 @@
 RELEASE NOTES of the MediaWiki extension RSS
 
-Version 2.18 20130220
+Version 2.19 20130226
 
 Manual http://www.mediawiki.org/wiki/Extension:RSS
 
@@ -27,6 +27,11 @@
   The length limitation must be HTML tag-safe, but it is not at the moment.
   Length limitation is disabled by default.
 
+=== 2.19 2013-02-26 ===
+* (bug 45387) $wgAllowImageTag variable name changed to $wgRSSAllowImageTag
+* problem that $wgRSSAllowImageTag was ignored (fixed)
+* (bug 45388) definition of all variables in RSS.php (fixed)
+
 === Version 2.18 2013-02-20 ===
 * release version
 
diff --git a/RSS.php b/RSS.php
index a1bde4e..cb86200 100644
--- a/RSS.php
+++ b/RSS.php
@@ -14,7 +14,7 @@
  * @link http://www.mediawiki.org/wiki/Extension:RSS Documentation
  */
 
-define( "EXTENSION_RSS_VERSION", "2.18 20130220" );
+define( "EXTENSION_RSS_VERSION", "2.19 20130226" );
 
 if ( !defined( 'MEDIAWIKI' ) ) {
        die( "This is not a valid entry point.\n" );
@@ -83,7 +83,8 @@
 $wgRSSUrlNumberOfAllowedRedirects = 0;
 
 // Agent to use for fetching feeds
-$wgRSSUserAgent = "MediaWikiRSS/" . strtok( EXTENSION_RSS_VERSION, " " ) . " 
(+http://www.mediawiki.org/wiki/Extension:RSS) / MediaWiki RSS extension";
+$wgRSSUserAgent = "MediaWikiRSS/" . strtok( EXTENSION_RSS_VERSION, " " ) .
+       " (+http://www.mediawiki.org/wiki/Extension:RSS) / MediaWiki RSS 
extension";
 
 // Proxy server to use for fetching feeds
 $wgRSSProxy = false;
@@ -98,3 +99,6 @@
 
 // You can choose to allow active links in feed items; default: false
 $wgRSSAllowLinkTag = false;
+
+// If you want to allow images (HTML <img> tag) in RSS feeds; default: false
+$wgRSSAllowImageTag = false;
diff --git a/RSSParser.php b/RSSParser.php
index 33a85ca..7c2d9f7 100644
--- a/RSSParser.php
+++ b/RSSParser.php
@@ -426,22 +426,31 @@
         * $wgRSSAllowLinkTag = true;
         *
         * If you want to allow images (HTML <img> tag) in RSS feeds:
-        * $wgAllowImageTag = true;
+        * $wgRSSAllowImageTag = true;
         *
         */
        protected function escapeTemplateParameter( $text ) {
-               global $wgRSSAllowLinkTag, $wgAllowImageTag;
+               global $wgRSSAllowLinkTag, $wgRSSAllowImageTag;
+
+               $extraInclude = array();
+               $extraExclude = array( "iframe" );
 
                if ( isset( $wgRSSAllowLinkTag ) && $wgRSSAllowLinkTag ) {
-                       $extra = array( "a" );
+                       $extraInclude[] = "a";
                } else {
-                       $extra = array();
+                       $extraExclude[] = "a";
+               }
+
+               if ( isset( $wgRSSAllowImageTag ) && $wgRSSAllowImageTag ) {
+                       $extraInclude[] = "img";
+               } else {
+                       $extraExclude[] = "img";
                }
 
                if ( ( isset( $wgRSSAllowLinkTag ) && $wgRSSAllowLinkTag )
-                       || ( isset( $wgAllowImageTag ) && $wgAllowImageTag ) ) {
+                       || ( isset( $wgRSSAllowImageTag ) && 
$wgRSSAllowImageTag ) ) {
 
-                       $ret = Sanitizer::removeHTMLtags( $text, null, array(), 
$extra, array( "iframe" ) );
+                       $ret = Sanitizer::removeHTMLtags( $text, null, array(), 
$extraInclude, $extraExclude );
 
                } else { // use the old escape method for a while
 

-- 
To view, visit https://gerrit.wikimedia.org/r/50888
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I112ebcdf492dfe80ba187fe6ab2406d3eed10f6a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RSS
Gerrit-Branch: master
Gerrit-Owner: Wikinaut <m...@tgries.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to