API: (bug 20967) action=edit allows creation of invalid titles that look like interwi...
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 6 Nov 2009 14:44:04 +0000 (14:44 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 6 Nov 2009 14:44:04 +0000 (14:44 +0000)
CREDITS
RELEASE-NOTES
includes/api/ApiEditPage.php

diff --git a/CREDITS b/CREDITS
index 61dea69..a2ae161 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -105,6 +105,7 @@ following names for their contribution to the product.
 * RenĂ© Kijewski
 * Robert Treat
 * RockMFR
+* Sam Reed
 * ST47
 * Scott Colcord
 * Simon Walker
index bf4aebc..116162d 100644 (file)
@@ -685,6 +685,7 @@ Hopefully we will remove this configuration var soon)
 * (bug 21083) list=allusers no longer returns current timestamp for users
   without registration date
 * (bug 20554) Expose average slave lag (avglag) as well as maxlag
+* (bug 20967) action=edit allows creation of invalid titles
 
 === Languages updated in 1.16 ===
 
index ccca373..dbbc80d 100644 (file)
@@ -56,8 +56,9 @@ class ApiEditPage extends ApiBase {
                        $this->dieUsageMsg(array('sessionfailure'));
 
                $titleObj = Title::newFromText($params['title']);
-               if(!$titleObj)
+               if(!$titleObj || $titleObj->isExternal())
                        $this->dieUsageMsg(array('invalidtitle', $params['title']));
+                       
                // Some functions depend on $wgTitle == $ep->mTitle
                global $wgTitle;
                $wgTitle = $titleObj;