Index: branches/REL1_18/extensions/GoogleNewsSitemap/FeedSMItem.php |
— | — | @@ -11,6 +11,11 @@ |
12 | 12 | private $keywords = array(); |
13 | 13 | |
14 | 14 | /** |
| 15 | + * @var Title |
| 16 | + */ |
| 17 | + private $titleObj; |
| 18 | + |
| 19 | + /** |
15 | 20 | * @param Title $title Title object that this entry is for. |
16 | 21 | * @param String $pubDate Publish date formattable by wfTimestamp. |
17 | 22 | * @param Array $keywords list of (String) keywords |
— | — | @@ -20,7 +25,7 @@ |
21 | 26 | * An integer for the page name of $title in the specific namespace denoted by that integer. |
22 | 27 | */ |
23 | 28 | public function __construct( $title, $pubDate, $keywords = '', $comment = true ) { |
24 | | - if ( !$title ) { |
| 29 | + if ( !$title || !$title instanceof Title ) { |
25 | 30 | // Paranoia |
26 | 31 | throw new MWException( 'Invalid title object passed to FeedSMItem' ); |
27 | 32 | } |
— | — | @@ -37,8 +42,8 @@ |
38 | 43 | } |
39 | 44 | } |
40 | 45 | |
41 | | - $this->title = $title; |
42 | 46 | $this->keywords = $keywords; |
| 47 | + $this->titleObj = $title; |
43 | 48 | |
44 | 49 | parent::__construct( $title->getText(), '' /* Description */, |
45 | 50 | $title->getFullURL(), $pubDate, '' /* Author */, $commentsURL ); |
— | — | @@ -62,7 +67,7 @@ |
63 | 68 | } |
64 | 69 | |
65 | 70 | public function getLastMod() { |
66 | | - return $this->title->getTouched(); |
| 71 | + return $this->titleObj->getTouched(); |
67 | 72 | } |
68 | 73 | |
69 | 74 | public function getKeywords() { |
— | — | @@ -86,15 +91,17 @@ |
87 | 92 | wfProfileIn( __METHOD__ ); |
88 | 93 | // This is probably rather inefficient to do for several pages |
89 | 94 | // but not much worse than the rest of this extension. |
| 95 | + |
| 96 | + $result = ''; |
90 | 97 | $req = new FauxRequest( array( |
91 | 98 | 'action' => 'parse', |
92 | | - 'page' => $this->title->getPrefixedDBKey(), |
| 99 | + 'page' => $this->titleObj->getPrefixedDBKey(), |
93 | 100 | 'prop' => 'text', |
94 | 101 | ) ); |
95 | 102 | $main = new ApiMain( $req ); |
96 | 103 | $main->execute(); |
97 | 104 | $data = $main->getResultData(); |
98 | | - $result = ''; |
| 105 | + |
99 | 106 | if ( isset( $data['parse']['text']['*'] ) ) { |
100 | 107 | $result = $this->xmlEncode( |
101 | 108 | $data['parse']['text']['*'] |
Property changes on: branches/REL1_18/extensions/GoogleNewsSitemap |
___________________________________________________________________ |
Modified: svn:mergeinfo |
102 | 109 | Merged /trunk/extensions/GoogleNewsSitemap:r109542 |
Property changes on: branches/REL1_18/extensions |
___________________________________________________________________ |
Modified: svn:mergeinfo |
103 | 110 | Merged /trunk/extensions:r109542 |