r109544 MediaWiki - Code Review archive

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

Diff [purge]

Index: branches/REL1_18/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() {
@@ -86,15 +91,17 @@
8792 wfProfileIn( __METHOD__ );
8893 // This is probably rather inefficient to do for several pages
8994 // but not much worse than the rest of this extension.
 95+
 96+ $result = '';
9097 $req = new FauxRequest( array(
9198 'action' => 'parse',
92 - 'page' => $this->title->getPrefixedDBKey(),
 99+ 'page' => $this->titleObj->getPrefixedDBKey(),
93100 'prop' => 'text',
94101 ) );
95102 $main = new ApiMain( $req );
96103 $main->execute();
97104 $data = $main->getResultData();
98 - $result = '';
 105+
99106 if ( isset( $data['parse']['text']['*'] ) ) {
100107 $result = $this->xmlEncode(
101108 $data['parse']['text']['*']
Property changes on: branches/REL1_18/extensions/GoogleNewsSitemap
___________________________________________________________________
Modified: svn:mergeinfo
102109 Merged /trunk/extensions/GoogleNewsSitemap:r109542
Property changes on: branches/REL1_18/extensions
___________________________________________________________________
Modified: svn:mergeinfo
103110 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