r109543 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109542‎ | r109543 | r109544 >
Date:16:22, 19 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/GoogleNewsSitemap (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/GoogleNewsSitemap/FeedSMItem.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/GoogleNewsSitemap/FeedSMItem.php
@@ -11,6 +11,11 @@
1212 private $keywords = array();
1313
1414 /**
 15+ * @var Title
 16+ */
 17+ private $titleObj;
 18+
 19+ /**
1520 * @param Title $title Title object that this entry is for.
1621 * @param String $pubDate Publish date formattable by wfTimestamp.
1722 * @param Array $keywords list of (String) keywords
@@ -20,7 +25,7 @@
2126 * An integer for the page name of $title in the specific namespace denoted by that integer.
2227 */
2328 public function __construct( $title, $pubDate, $keywords = '', $comment = true ) {
24 - if ( !$title ) {
 29+ if ( !$title || !$title instanceof Title ) {
2530 // Paranoia
2631 throw new MWException( 'Invalid title object passed to FeedSMItem' );
2732 }
@@ -37,8 +42,8 @@
3843 }
3944 }
4045
41 - $this->title = $title;
4246 $this->keywords = $keywords;
 47+ $this->titleObj = $title;
4348
4449 parent::__construct( $title->getText(), '' /* Description */,
4550 $title->getFullURL(), $pubDate, '' /* Author */, $commentsURL );
@@ -62,7 +67,7 @@
6368 }
6469
6570 public function getLastMod() {
66 - return $this->title->getTouched();
 71+ return $this->titleObj->getTouched();
6772 }
6873
6974 public function getKeywords() {
@@ -88,12 +93,9 @@
8994 // but not much worse than the rest of this extension.
9095
9196 $result = '';
92 - if ( !$this->title ) {
93 - return $result;
94 - }
9597 $req = new FauxRequest( array(
9698 'action' => 'parse',
97 - 'page' => $this->title->getPrefixedDBKey(),
 99+ 'page' => $this->titleObj->getPrefixedDBKey(),
98100 'prop' => 'text',
99101 ) );
100102 $main = new ApiMain( $req );
Property changes on: branches/wmf/1.18wmf1/extensions/GoogleNewsSitemap
___________________________________________________________________
Modified: svn:mergeinfo
101103 Merged /trunk/extensions/GoogleNewsSitemap:r109542
Property changes on: branches/wmf/1.18wmf1/extensions
___________________________________________________________________
Modified: svn:mergeinfo
102104 Merged /trunk/extensions:r109542

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109542Fix object munging to fix (bug 33818) GoogleNewsSitemap failing to return feeds...reedy16:20, 19 January 2012

Status & tagging log