MovePage methods need to run safety checks
authorAryeh Gregor <ayg@aryeh.name>
Tue, 16 Apr 2019 12:37:41 +0000 (15:37 +0300)
committerAryeh Gregor <ayg@aryeh.name>
Mon, 6 May 2019 07:04:26 +0000 (10:04 +0300)
commit24949e738d837a3c97619791febf36e62ee113f3
tree278547d5f358f41f8ce70f1a83e45677fc795c4d
parent427fbee7343c2955ad1e666be6a69c30a2234e11
MovePage methods need to run safety checks

A move method that doesn't check for things like moving a page on top of
itself or moving to a namespace with a different content model does not
seem like it's what callers would expect, and not what Title::moveTo
ever did. If there's a caller that really wants this behavior, we can
make moveUnsafe public.

I also made the $reason and $createRedirect parameters to move()
optional to match Title::moveTo() behavior. However, I made $reason
default to null instead of '', to distinguish between an empty edit
reason provided by the user and no edit reason provided at all (e.g., a
move done internally without specific user request).

Depends-On: I971e619eb76c4474fe037fad258f9c496717bf41
Change-Id: I6ddcc9f34a48f997ae39b79cd2df40dd2cc10197
includes/MovePage.php
includes/Title.php
includes/specials/SpecialMovepage.php