From 51075767d14797357025eee63c8f31438219567e Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Thu, 26 Mar 2015 00:55:16 +0100 Subject: [PATCH] ApiParse: Forbid section=new when using page, pageid, or oldid Change-Id: I45ce0fe2083587e429143aa3d8d832aa884e1ad7 --- includes/api/ApiParse.php | 3 +++ 1 file changed, 3 insertions(+) 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 ); -- 2.20.1