ApiFeedRecentChanges: Validate param target
authorNiklas Laxström <niklas.laxstrom@gmail.com>
Sat, 29 Mar 2014 16:00:18 +0000 (16:00 +0000)
committerNiklas Laxström <niklas.laxstrom@gmail.com>
Thu, 3 Apr 2014 14:15:49 +0000 (14:15 +0000)
Change-Id: I6933177d47c25d48b9b55d479afa4dedcc64299d

includes/api/ApiFeedRecentChanges.php

index f1c1bf3..9062ad9 100644 (file)
@@ -80,6 +80,10 @@ class ApiFeedRecentChanges extends ApiBase {
        public function getFeedObject( $feedFormat, $specialClass ) {
                if ( $specialClass === 'SpecialRecentchangeslinked' ) {
                        $title = Title::newFromText( $this->params['target'] );
+                       if ( !$title ) {
+                               $this->dieUsageMsg( array( 'invalidtitle', $this->params['target'] ) );
+                       }
+
                        $feed = new ChangesFeed( $feedFormat, false );
                        $feedObj = $feed->getFeedObject(
                                $this->msg( 'recentchangeslinked-title', $title->getPrefixedText() )