From: Derk-Jan Hartman Date: Wed, 25 Mar 2015 23:55:16 +0000 (+0100) Subject: ApiParse: Forbid section=new when using page, pageid, or oldid X-Git-Tag: 1.31.0-rc.0~11986^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=51075767d14797357025eee63c8f31438219567e;p=lhc%2Fweb%2Fwiklou.git ApiParse: Forbid section=new when using page, pageid, or oldid Change-Id: I45ce0fe2083587e429143aa3d8d832aa884e1ad7 --- diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 20592ca290..b621861655 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -88,6 +88,9 @@ class ApiParse extends ApiBase { $result = $this->getResult(); if ( !is_null( $oldid ) || !is_null( $pageid ) || !is_null( $page ) ) { + if ( $this->section === 'new' ) { + $this->dieUsage( 'section=new cannot be combined with oldid, pageid or page parameters. Please use text', 'params' ); + } if ( !is_null( $oldid ) ) { // Don't use the parser cache $rev = Revision::newFromId( $oldid );