which are not of known image types. This is in response to
http://en.wikipedia.org/wiki/Windows_Metafile_vulnerability
* (bug 4507) Adjust FULLPAGENAMEE escaping to standard form
+* Disallow users to use rollback when blocked
=== Caveats ===
global $wgUser, $wgOut, $wgRequest, $wgUseRCPatrol;
$fname = 'Article::rollback';
- if ( ! $wgUser->isAllowed('rollback') ) {
+ if( $wgUser->isAllowed( 'rollback' ) ) {
+ if( $wgUser->isBlocked() ) {
+ $wgOut->blockedPage();
+ return;
+ }
+ } else {
$wgOut->sysopRequired();
return;
}
+
if ( wfReadOnly() ) {
$wgOut->readOnlyPage( $this->getContent( true ) );
return;
# When previewing, don't check blocked state - will get caught at save time.
# Also, check when starting edition is done against slave to improve performance.
wfDebug( "$fname: user is blocked\n" );
- $this->blockedIPpage();
+ $wgOut->blockedPage();
wfProfileOut( $fname );
return;
}
* @todo document
*/
function blockedIPpage() {
- global $wgOut, $wgUser, $wgContLang;
-
- $wgOut->setPageTitle( wfMsg( 'blockedtitle' ) );
- $wgOut->setRobotpolicy( 'noindex,nofollow' );
- $wgOut->setArticleRelated( false );
-
- $id = $wgUser->blockedBy();
- $reason = $wgUser->blockedFor();
- $ip = wfGetIP();
-
- if ( is_numeric( $id ) ) {
- $name = User::whoIs( $id );
- } else {
- $name = $id;
- }
- $link = '[[' . $wgContLang->getNsText( NS_USER ) .
- ":{$name}|{$name}]]";
-
- $wgOut->addWikiText( wfMsg( 'blockedtext', $link, $reason, $ip, $name ) );
- $wgOut->returnToMain( false );
+ global $wgOut;
+ $wgOut->blockedPage();
}
/**
$time = wfReportTime();
return $time;
}
+
+ /**
+ * Produce a "user is blocked" page
+ */
+ function blockedPage() {
+ global $wgUser, $wgContLang;
+
+ $this->setPageTitle( wfMsg( 'blockedtitle' ) );
+ $this->setRobotpolicy( 'noindex,nofollow' );
+ $this->setArticleRelated( false );
+
+ $id = $wgUser->blockedBy();
+ $reason = $wgUser->blockedFor();
+ $ip = wfGetIP();
+
+ if ( is_numeric( $id ) ) {
+ $name = User::whoIs( $id );
+ } else {
+ $name = $id;
+ }
+ $link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]";
+
+ $this->addWikiText( wfMsg( 'blockedtext', $link, $reason, $ip, $name ) );
+ $this->returnToMain( false );
+ }
/**
* Note: these arguments are keys into wfMsg(), not text!