r76641 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76640‎ | r76641 | r76642 >
Date:19:11, 13 November 2010
Author:catrope
Status:ok
Tags:
Comment:
RSS: instanceOf -> instanceof, $ERROR -> $error
Modified paths:
  • /trunk/extensions/RSS/RSSData.php (modified) (history)
  • /trunk/extensions/RSS/RSSHooks.php (modified) (history)
  • /trunk/extensions/RSS/RSSParser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RSS/RSSHooks.php
@@ -21,7 +21,7 @@
2222 static function renderRss( $input, $args, $parser, $frame ) {
2323 global $wgRSSCacheAge, $wgRSSCacheCompare;
2424
25 - if ( !HTTP::isValidURI( $input ) ) {
 25+ if ( !Http::isValidURI( $input ) ) {
2626 return wfMsg( 'rss-invalid-url', htmlspecialchars( $input ) );
2727 }
2828 if ( $wgRSSCacheCompare ) {
Index: trunk/extensions/RSS/RSSData.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class RSSData {
5 - public $ERROR;
 5+ public $error;
66 public $items;
77
88 /**
@@ -10,8 +10,8 @@
1111 * @return Object RSSData object with a member items that is an array of parsed items,
1212 */
1313 function __construct( $xml ) {
14 - if ( !( $xml instanceOf DOMDocument ) ) {
15 - $this->ERROR = "Not passed DOMDocument object.";
 14+ if ( !( $xml instanceof DOMDocument ) ) {
 15+ $this->error = "Not passed DOMDocument object.";
1616 return;
1717 }
1818 $xpath = new DOMXPath( $xml );
@@ -37,7 +37,7 @@
3838 $this->items[] = $bit;
3939 }
4040 } else {
41 - $this->ERROR = 'No RSS items found.';
 41+ $this->error = 'No RSS items found.';
4242 return;
4343 }
4444 }
Index: trunk/extensions/RSS/RSSParser.php
@@ -12,7 +12,7 @@
1313 protected $etag;
1414 protected $lastModified;
1515 protected $xml;
16 - protected $ERROR;
 16+ protected $error;
1717 protected $displayFields = array( 'author', 'title', 'encodedContent', 'description' );
1818
1919 public $client;
@@ -312,7 +312,7 @@
313313 $this->rss = new RSSData( $this->xml );
314314
315315 // if RSS parsed successfully
316 - if ( $this->rss && !$this->rss->ERROR ) {
 316+ if ( $this->rss && !$this->rss->error ) {
317317 $this->etag = $this->client->getResponseHeader( 'Etag' );
318318 $this->lastModified =
319319 strtotime( $this->client->getResponseHeader( 'Last-Modified' ) );
@@ -322,7 +322,7 @@
323323 count( $this->rss->items ) . ')!' );
324324 $this->storeInCache( $key );
325325 } else {
326 - return Status::newFatal( 'rss-parse-error', $this->rss->ERROR );
 326+ return Status::newFatal( 'rss-parse-error', $this->rss->error );
327327 }
328328 }
329329 return Status::newGood();

Status & tagging log