$nt: new title
$user: user who is doing the move
$err: error message
+$reason: the reason for the move (added in 1.13)
'AbortNewAccount': Return false to cancel account creation.
$user: the User object about to be created (read-only, incomplete)
* @param Title &$nt the new title
* @param bool $auth indicates whether $wgUser's permissions
* should be checked
+ * @param string $reason is the log summary of the move, used for spam checking
* @return mixed True on success, getUserPermissionsErrors()-like array on failure
*/
- public function isValidMoveOperation( &$nt, $auth = true ) {
+ public function isValidMoveOperation( &$nt, $auth = true, $reason = '' ) {
$errors = array();
if( !$nt ) {
// Normally we'd add this to $errors, but we'll get
global $wgUser;
$err = null;
- if( !wfRunHooks( 'AbortMove', array( $this, $nt, $wgUser, &$err ) ) ) {
+ if( !wfRunHooks( 'AbortMove', array( $this, $nt, $wgUser, &$err, $reason ) ) ) {
$errors[] = array('hookaborted', $err);
}
* @return mixed true on success, getUserPermissionsErrors()-like array on failure
*/
public function moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true ) {
- $err = $this->isValidMoveOperation( $nt, $auth );
+ $err = $this->isValidMoveOperation( $nt, $auth, $reason );
if( is_array( $err ) ) {
return $err;
}