From ff0a67c75e072bc3819c6265b3fe04e2c044b3cd Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Mon, 3 Jan 2011 23:20:13 +0000 Subject: [PATCH] make action=parse return a missingtitle error if the page param refers to a missing (rather than just invalid) title --- RELEASE-NOTES | 1 + includes/api/ApiParse.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1ee6a97a61..fcf713f757 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -65,6 +65,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Add a realname uiprop option to query=userinfo so a user's realname can be extracted * Add a &watchuser option to ApiBlock * (bug 26541) Generator-ise ApiQueryRecentChanges +* action=parse now correctly returns an error for nonexistent pages === Languages updated in 1.18 === diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 6fb0489c1a..1a3956b953 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -136,7 +136,7 @@ class ApiParse extends ApiBase { $to = $page; } $titleObj = Title::newFromText( $to ); - if ( !$titleObj ) { + if ( !$titleObj || !$titleObj->exists() ) { $this->dieUsage( "The page you specified doesn't exist", 'missingtitle' ); } } -- 2.20.1