Index: trunk/extensions/RSS/RELEASE-NOTES |
— | — | @@ -13,6 +13,10 @@ |
14 | 14 | * bug 30028 "Error parsing XML for RSS" - improve and harden Extension:RSS when |
15 | 15 | parsing differently flavoured RSS feeds and ATOM feeds |
16 | 16 | |
| 17 | +=== Version 2.01 2012-02-24 === |
| 18 | +* "summary" element of ATOM feed items are shown |
| 19 | + which is handled like "description" element of RSS |
| 20 | +* handling of basic HTML layout tags <p> <br> <b> <i> <u> <s> in item description |
17 | 21 | === Version 2.00 2012-02-24 === |
18 | 22 | * first version which can parse RSS and at least some ATOM feeds |
19 | 23 | partial solution of bug 30028 "Error parsing XML for RSS" - improve and harden |
Index: trunk/extensions/RSS/RSSData.php |
— | — | @@ -81,8 +81,8 @@ |
82 | 82 | return 'date'; |
83 | 83 | case 'dc:creator': |
84 | 84 | return 'author'; |
85 | | - case 'title': |
86 | | - return 'title'; |
| 85 | + case 'summary': |
| 86 | + return 'description'; |
87 | 87 | case 'content:encoded': |
88 | 88 | return 'encodedContent'; |
89 | 89 | |
Index: trunk/extensions/RSS/RSSParser.php |
— | — | @@ -391,18 +391,46 @@ |
392 | 392 | |
393 | 393 | /** |
394 | 394 | * Sanitize user input for inclusion as a template parameter. |
| 395 | + * |
395 | 396 | * Unlike in wfEscapeWikiText() as of r77127, this escapes }} in addition |
396 | 397 | * to the other kinds of markup, to avoid user input ending a template |
397 | 398 | * invocation. |
| 399 | + * |
| 400 | + * We change differently flavoured <p> and <br> tags to effective <br> tags, |
| 401 | + * other tags such as <a> will be rendered html-escaped. |
| 402 | + * |
398 | 403 | */ |
399 | 404 | protected function escapeTemplateParameter( $text ) { |
400 | | - return str_replace( |
| 405 | + $text = str_replace( |
401 | 406 | array( '[', '|', ']', '\'', 'ISBN ', |
402 | | - 'RFC ', '://', "\n=", '{{', '}}' ), |
| 407 | + 'RFC ', '://', "\n=", '{{', '}}', |
| 408 | + ), |
403 | 409 | array( '[', '|', ']', ''', 'ISBN ', |
404 | | - 'RFC ', '://', "\n=", '{{', '}}' ), |
405 | | - htmlspecialchars( $text ) |
| 410 | + 'RFC ', '://', "\n=", '{{', '}}', |
| 411 | + ), |
| 412 | + htmlspecialchars( str_replace( "\n", "", $text ) ) |
406 | 413 | ); |
| 414 | + |
| 415 | + // keep some basic layout tags |
| 416 | + $text = str_replace( |
| 417 | + array( '<p>', '</p>', |
| 418 | + '<br/>', '<br>', '</br>', |
| 419 | + '<b>', '</b>', |
| 420 | + '<i>', '</i>', |
| 421 | + '<u>', '</u>', |
| 422 | + '<s>', '</s>', |
| 423 | + ), |
| 424 | + array( "", "<br/>", |
| 425 | + "<br/>", "<br/>", "<br/>", |
| 426 | + "'''", "'''", |
| 427 | + "''", "''", |
| 428 | + "<u>", "</u>", |
| 429 | + "<s>", "</s>", |
| 430 | + ), |
| 431 | + $text |
| 432 | + ); |
| 433 | + |
| 434 | + return $text; |
407 | 435 | } |
408 | 436 | |
409 | 437 | /** |
Index: trunk/extensions/RSS/RSS.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @ingroup Extensions |
8 | | - * @version 2.00 |
| 8 | + * @version 2.01 |
9 | 9 | * @author mutante, Daniel Kinzler, Rdb, Mafs, Thomas Gries, Alxndr, Chris Reigrut, K001 |
10 | 10 | * @author Kellan Elliott-McCrea <kellan@protest.net> -- author of MagpieRSS |
11 | 11 | * @author Jeroen De Dauw |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | * @link http://www.mediawiki.org/wiki/Extension:RSS Documentation |
16 | 16 | */ |
17 | 17 | |
18 | | -define( "EXTENSION_RSS_VERSION", "2.00 20120224" ); |
| 18 | +define( "EXTENSION_RSS_VERSION", "2.01 20120224" ); |
19 | 19 | |
20 | 20 | if ( !defined( 'MEDIAWIKI' ) ) { |
21 | 21 | die( "This is not a valid entry point.\n" ); |