From b9b85843572bf283f48285001e276ba7e61b63f6 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 22 Feb 2009 13:37:51 +0100 Subject: updated to MediaWiki 1.14.0 --- includes/Feed.php | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'includes/Feed.php') diff --git a/includes/Feed.php b/includes/Feed.php index 512057d9..fe6d8feb 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -52,25 +52,45 @@ class FeedItem { $this->Comments = $Comments; } - /** - * @static - */ - 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 ); + } /**#@-*/ } @@ -149,7 +169,7 @@ class ChannelFeed extends FeedItem { global $wgStylePath, $wgStyleVersion; $this->httpHeaders(); - echo '' . "\n"; + echo '' . "\n"; echo '\n"; -- cgit v1.2.2