From: Roan Kattouw Date: Fri, 6 Nov 2009 14:44:04 +0000 (+0000) Subject: API: (bug 20967) action=edit allows creation of invalid titles that look like interwi... X-Git-Tag: 1.31.0-rc.0~38944 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=f9d79167d389dcfea785ad9a4666202e6ddecdaa;p=lhc%2Fweb%2Fwiklou.git API: (bug 20967) action=edit allows creation of invalid titles that look like interwiki titles. Patch by Sam Reed --- diff --git a/CREDITS b/CREDITS index 61dea69c81..a2ae16160e 100644 --- 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 diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bf4aebcd27..116162d841 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index ccca3736f6..dbbc80d6a5 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -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;