Ensure users are able to edit the page after changing the content model
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 11 Sep 2016 05:14:04 +0000 (22:14 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Fri, 23 Sep 2016 05:22:48 +0000 (22:22 -0700)
commit2108c55ec531fbf44d0736b2ce5c532d677669da
treed578ba797ac77f0f4ed6c78da37fd6d23c12f5c7
parent8cf47509be6e9eeb8e14fbc869007f471b36b7b4
Ensure users are able to edit the page after changing the content model

It is possible for page restrictions to be dependent upon the content
model a page. The best example of this is user JavaScript and CSS
subpages. This adds a Title::setContentModel() function which allows
mocking a Title's content model for the purpose of permission checks.

EditPage and Special:ChangeContentModel were updated to ensure the user
can edit the page with the newly proposed content model before making
the change.

Title::$mContentModel was made private to make sure nothing else mucks
around with it. There were no uses outside of Title anyways.

Bug: T145316
Change-Id: I28c46f408cadf65ed1868401cd00dc15e5acd2fe
includes/EditPage.php
includes/Title.php
includes/specials/SpecialChangeContentModel.php