Wikinaut has uploaded a new change for review.

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


Change subject: Bug 55763
......................................................................

Bug 55763

Change-Id: I4329c4e652f3025ddcca4bcd38dedc33b1a378a6
---
M RELEASE-NOTES
M RSS.php
M RSSData.php
M RSSParser.php
4 files changed, 29 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RSS 
refs/changes/41/90441/2

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 0891205..1d85971 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,6 +1,6 @@
 RELEASE NOTES of the MediaWiki extension RSS
 
-Version 2.23 20130903
+Version 2.24 20131017
 
 Manual http://www.mediawiki.org/wiki/Extension:RSS
 
@@ -27,6 +27,9 @@
   The length limitation must be HTML tag-safe, but it is not at the moment.
   Length limitation is disabled by default.
 
+=== Version 2.24 2013-10-17 ==
+* fix for Bug 55763 Undefined variable: txt in RSSParser.php on line 376
+
 === Version 2.23 2013-09-03 ===
 * Fix parsing from CLI:
   removed references to $wgTitle, $wgUser, and $wgLang.
diff --git a/RSS.php b/RSS.php
index c3aad25..05f4b05 100644
--- a/RSS.php
+++ b/RSS.php
@@ -4,7 +4,7 @@
  *
  * @file
  * @ingroup Extensions
- * @version 2.22
+ * @version 2.24
  * @author mutante, Daniel Kinzler, Rdb, Mafs, Thomas Gries, Alxndr, Chris 
Reigrut, K001
  * @author Kellan Elliott-McCrea <[email protected]> -- author of MagpieRSS
  * @author Jeroen De Dauw
@@ -14,7 +14,7 @@
  * @link http://www.mediawiki.org/wiki/Extension:RSS Documentation
  */
 
-define( "EXTENSION_RSS_VERSION", "2.23" );
+define( "EXTENSION_RSS_VERSION", "2.24" );
 
 if ( !defined( 'MEDIAWIKI' ) ) {
        die( "This is not a valid entry point.\n" );
diff --git a/RSSData.php b/RSSData.php
index 96f0ea3..9ac81c5 100644
--- a/RSSData.php
+++ b/RSSData.php
@@ -41,7 +41,7 @@
                                         * mark up their RSS, some more 
precautions are
                                         * needed.
                                         */
-                                       $bit[$name] = $n->nodeValue;
+                                       $bit[$name] = trim( $n->nodeValue );
                                }
                        }
                        $this->items[] = $bit;
diff --git a/RSSParser.php b/RSSParser.php
index f313c48..a0cc138 100644
--- a/RSSParser.php
+++ b/RSSParser.php
@@ -363,30 +363,30 @@
                // use the overloaded multi byte wrapper functions in 
GlobalFunctions.php
 
                foreach ( array_keys( $item ) as $info ) {
-                       switch ( $info ) {
-                       // ATOM <id> elements and RSS <link> elements are item 
link urls
-                       case 'id':
-                               $txt = $this->sanitizeUrl( $item['id'] );
-                               $renderedItem = str_replace( '{{{link}}}', 
$txt, $renderedItem );
-                               break;
-                       case 'link':
-                               if ( !isset( $item['id'] ) ) {
+                       if ( $item[$info] != "" ) {
+                               switch ( $info ) {
+                               // ATOM <id> elements and RSS <link> elements 
are item link urls
+                               case 'id':
+                                       $txt = $this->sanitizeUrl( $item['id'] 
);
+                                       $renderedItem = str_replace( 
'{{{link}}}', $txt, $renderedItem );
+                                       break;
+                               case 'link':
                                        $txt = $this->sanitizeUrl( 
$item['link'] );
+                                       $renderedItem = str_replace( 
'{{{link}}}', $txt, $renderedItem );
+                                       break;
+                               case 'date':
+                                       $tempTimezone = 
date_default_timezone_get();
+                                       date_default_timezone_set( 'UTC' );
+                                       $txt = date( $this->date, strtotime( 
$this->escapeTemplateParameter( $item['date'] ) ) );
+                                       date_default_timezone_set( 
$tempTimezone );
+                                       $renderedItem = str_replace( 
'{{{date}}}', $txt, $renderedItem );
+                                       break;
+                               default:
+                                       $str = $this->escapeTemplateParameter( 
$item[$info] );
+                                       $str = 
$parser->getFunctionLang()->truncate( $str, $this->ItemMaxLength );
+                                       $str = $this->highlightTerms( $str );
+                                       $renderedItem = str_replace( '{{{' . 
$info . '}}}', $parser->insertStripItem( $str ), $renderedItem );
                                }
-                               $renderedItem = str_replace( '{{{link}}}', 
$txt, $renderedItem );
-                               break;
-                       case 'date':
-                               $tempTimezone = date_default_timezone_get();
-                               date_default_timezone_set( 'UTC' );
-                               $txt = date( $this->date, strtotime( 
$this->escapeTemplateParameter( $item['date'] ) ) );
-                               date_default_timezone_set( $tempTimezone );
-                               $renderedItem = str_replace( '{{{date}}}', 
$txt, $renderedItem );
-                               break;
-                       default:
-                               $str = $this->escapeTemplateParameter( 
$item[$info] );
-                               $str = $parser->getFunctionLang()->truncate( 
$str, $this->ItemMaxLength );
-                               $str = $this->highlightTerms( $str );
-                               $renderedItem = str_replace( '{{{' . $info . 
'}}}', $parser->insertStripItem( $str ), $renderedItem );
                        }
                }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4329c4e652f3025ddcca4bcd38dedc33b1a378a6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/RSS
Gerrit-Branch: master
Gerrit-Owner: Wikinaut <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to