X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiComparePages.php;h=1e35c349cc2597651045b9119f6303227093f5b3;hb=c58873fb4213447615761a55fd2be72fa53f8ec2;hp=6b894c17f169649c843e6d36e366054ce251099d;hpb=de433e5b6e7be471cebd2d7387e40f338eade583;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php index 6b894c17f1..1e35c349cc 100644 --- a/includes/api/ApiComparePages.php +++ b/includes/api/ApiComparePages.php @@ -81,17 +81,17 @@ class ApiComparePages extends ApiBase { * @return int */ private function revisionOrTitleOrId( $revision, $titleText, $titleId ) { - if( $revision ) { + if ( $revision ) { return $revision; - } elseif( $titleText ) { + } elseif ( $titleText ) { $title = Title::newFromText( $titleText ); - if( !$title ) { + if ( !$title || $title->isExternal() ) { $this->dieUsageMsg( array( 'invalidtitle', $titleText ) ); } return $title->getLatestRevID(); } elseif ( $titleId ) { $title = Title::newFromID( $titleId ); - if( !$title ) { + if ( !$title ) { $this->dieUsageMsg( array( 'nosuchpageid', $titleId ) ); } return $title->getLatestRevID();