$this->Comments = $Comments;
}
- function xmlEncode( $string ) {
+ public function xmlEncode( $string ) {
$string = str_replace( "\r\n", "\n", $string );
$string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', '', $string );
return htmlspecialchars( $string );
}
- function getTitle() { return $this->xmlEncode( $this->Title ); }
- function getUrl() { return $this->xmlEncode( $this->Url ); }
- function getDescription() { return $this->xmlEncode( $this->Description ); }
- function getLanguage() {
+ public function getTitle() {
+ return $this->xmlEncode( $this->Title );
+ }
+
+ public function getUrl() {
+ return $this->xmlEncode( $this->Url );
+ }
+
+ public function getDescription() {
+ return $this->xmlEncode( $this->Description );
+ }
+
+ public function getLanguage() {
global $wgContLanguageCode;
return $wgContLanguageCode;
}
- function getDate() { return $this->Date; }
- function getAuthor() { return $this->xmlEncode( $this->Author ); }
- function getComments() { return $this->xmlEncode( $this->Comments ); }
+
+ public function getDate() {
+ return $this->Date;
+ }
+ public function getAuthor() {
+ return $this->xmlEncode( $this->Author );
+ }
+ public function getComments() {
+ return $this->xmlEncode( $this->Comments );
+ }
+
+ /**
+ * Quickie hack... strip out wikilinks to more legible form from the comment.
+ */
+ public static function stripComment( $text ) {
+ return preg_replace( '/\[\[([^]]*\|)?([^]]+)\]\]/', '\2', $text );
+ }
/**#@-*/
}
$rev->getUserText(),
$wgContLang->timeanddate( $rev->getTimestamp() ) );
} else {
- $title = $rev->getUserText() . ": " . $this->stripComment( $rev->getComment() );
+ $title = $rev->getUserText() . ": " . FeedItem::stripComment( $rev->getComment() );
}
return new FeedItem(
$rev->getUserText(),
$this->mTitle->getTalkPage()->getFullUrl() );
}
-
- /**
- * Quickie hack... strip out wikilinks to more legible form from the comment.
- */
- function stripComment( $text ) {
- return preg_replace( '/\[\[([^]]*\|)?([^]]+)\]\]/', '\2', $text );
- }
}
}
}
- /**
- * Quickie hack... strip out wikilinks to more legible form from the comment.
- */
- protected function stripComment( $text ) {
- return preg_replace( '/\[\[([^]]*\|)?([^]]+)\]\]/', '\2', $text );
- }
-
protected function feedItemAuthor( $revision ) {
return $revision->getUserText();
}
protected function feedItemDesc( $revision ) {
if( $revision ) {
return '<p>' . htmlspecialchars( $revision->getUserText() ) . ': ' .
- htmlspecialchars( $this->stripComment( $revision->getComment() ) ) .
+ htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
"</p>\n<hr />\n<div>" .
nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
}
}
}
- /**
- * Quickie hack... strip out wikilinks to more legible form from the comment.
- */
- protected function stripComment( $text ) {
- return preg_replace( '/\[\[([^]]*\|)?([^]]+)\]\]/', '\2', $text );
- }
-
protected function feedItemAuthor( $row ) {
return isset( $row->rc_user_text ) ? $row->rc_user_text : '';
}
$revision = Revision::newFromId( $row->rev_id );
if( $revision ) {
return '<p>' . htmlspecialchars( $revision->getUserText() ) . ': ' .
- htmlspecialchars( $this->stripComment( $revision->getComment() ) ) .
+ htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
"</p>\n<hr />\n<div>" .
nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
}