r40992 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40991‎ | r40992 | r40993 >
Date:16:29, 18 September 2008
Author:yaron
Status:old
Tags:
Comment:
Improved access control
Modified paths:
  • /trunk/extensions/ReplaceText/SpecialReplaceText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReplaceText/SpecialReplaceText.php
@@ -7,12 +7,19 @@
88 /**
99 * Constructor
1010 */
11 - function ReplaceText() {
12 - SpecialPage::SpecialPage('ReplaceText');
 11+ public function __construct() {
 12+ parent::__construct('ReplaceText', 'replacetext');
1313 wfLoadExtensionMessages('ReplaceText');
1414 }
1515
1616 function execute() {
 17+ global $wgUser, $wgOut;
 18+
 19+ if ( ! $wgUser->isAllowed('replacetext') ) {
 20+ $wgOut->permissionRequired('replacetext');
 21+ return;
 22+ }
 23+
1724 $this->setHeaders();
1825 doSpecialReplaceText();
1926 }