make action=parse return a missingtitle error if the page param refers to a missing...
authorIlmari Karonen <vyznev@users.mediawiki.org>
Mon, 3 Jan 2011 23:20:13 +0000 (23:20 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Mon, 3 Jan 2011 23:20:13 +0000 (23:20 +0000)
RELEASE-NOTES
includes/api/ApiParse.php

index 1ee6a97..fcf713f 100644 (file)
@@ -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 ===
 
index 6fb0489..1a3956b 100644 (file)
@@ -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' );
                                        }
                                }