r62484 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62483‎ | r62484 | r62485 >
Date:23:05, 14 February 2010
Author:avar
Status:deferred
Tags:
Comment:
Give users slighly less rope to hang themselves by enabling this
extension only for users with 'eval' permission.

Set something like:

$wgGroupPermissions['sysop']['eval'] = true;

In LocalSettings.php to enable it.
Modified paths:
  • /trunk/extensions/Eval/SpecialEval.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Eval/SpecialEval.class.php
@@ -11,11 +11,16 @@
1212 }
1313
1414 public function execute( $par ) {
15 - global $wgOut, $wgRequest, $wgUseTidy;
 15+ global $wgUser, $wgOut, $wgRequest, $wgUseTidy;
1616 wfLoadExtensionMessages( 'Eval' );
1717
1818 $this->setHeaders();
1919
 20+ if ( !$this->userCanExecute( $wgUser ) ) {
 21+ $this->displayRestrictionError();
 22+ return;
 23+ }
 24+
2025 $code = isset( $par ) ? $par : $wgRequest->getText( 'code' );
2126 $escape = $wgRequest->getBool( 'escape' );
2227

Status & tagging log