There's already the AbortMove hook (see
http://www.mediawiki.org/wiki/Manual:Hooks/AbortMove).

Alexandre Emsenhuber (ialex)


Le 15.12.2008 20:06, « Eric K » <ek79...@yahoo.com> a écrit :

> There's no code that can interrupt a Title Move. I have added a little snippet
> into Title.php that does this and allows me to stop a user from doing a Title
> Move under many userful conditions. One of them includes monitoring how many
> title moves they're doing in a certain amount of amount of time. That helps
> stop Page-move vandalism and has saved my wiki many times.
> The Page Edit hook exists which is useful in a similiar way, but there was no
> hook for Title Move. Do the developers of MW think this Title Move hook is a
> good idea perhaps to include in the default code? Its only a few lines of
> code.
> On line 2517 of /includes/Title.php, we have:
> ---------
> $pageid = $this->getArticleID();  
> if( $nt->exists() ) {
> ---------
>  
> Between these two lines of code, I have included the following (in bold):
> ---------------
> $pageid = $this->getArticleID();
> 
>   global $wgUser;
>   $fname = 'Article::MoveArticle';
>   wfProfileIn( $fname );
>        if( !wfRunHooks( 'TitleMove', array( &$this, &$wgUser, &$nt, NULL ) ) )
> {
>    wfDebug( "$fname: TitleMove hook aborted move!\n" );
>    wfProfileOut( $fname );
>    return false;
>   }
> if( $nt->exists() ) {
> ---------------
>  
> 
> 
>       
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to