diff --git a/README b/README index 2510faa6..6bff8dd0 100644 --- a/README +++ b/README @@ -38,7 +38,7 @@ your MediaWiki 'extensions' directory, then add the following line to your wfLoadExtension( 'ReplaceText' ); -In order to perform replacements, you must have the 'replacetext' permssion; +In order to perform replacements, you must have the 'replacetext' permission; if you are an administrator on your wiki, the easiest way to do this is to also add the following line: diff --git a/src/Hooks.php b/src/Hooks.php index c05b6cec..ff00ae4f 100644 --- a/src/Hooks.php +++ b/src/Hooks.php @@ -89,6 +89,9 @@ class Hooks implements * @param Title $nt Title object of the new article (moved to) */ public function onSpecialMovepageAfterMove( $form, $ot, $nt ) { + if ( !$form->getUser()->isAllowed( 'replacetext' ) ) { + return; + } $out = $form->getOutput(); $page = $this->specialPageFactory->getPage( 'ReplaceText' ); $pageLink = $form->getLinkRenderer()->makeLink( $page->getPageTitle() );