r40117 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40116‎ | r40117 | r40118 >
Date:00:54, 28 August 2008
Author:nad
Status:old
Tags:
Comment:
warnings were being generated when php using E_ALL
Modified paths:
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php
@@ -18,7 +18,7 @@
1919
2020 if (!defined('MEDIAWIKI')) die('Not an entry point.');
2121
22 -define('SIMPLESECURITY_VERSION', '4.2.5, 2008-08-27');
 22+define('SIMPLESECURITY_VERSION', '4.2.6, 2008-08-28');
2323
2424 # Global security settings
2525 $wgSecurityMagicIf = "ifusercan"; # the name for doing a permission-based conditional
@@ -200,14 +200,15 @@
201201
202202 # Hack to prevent specialpage operations on unreadable pages
203203 if (!is_object($wgTitle)) return true;
204 - $ns = $wgTitle->getNamespace();
 204+ $title = $wgTitle;
 205+ $ns = $title->getNamespace();
205206 if ($ns == NS_SPECIAL) {
206 - list($name, $par) = explode('/', $wgTitle->getDBkey(), 2);
 207+ list($name, $par) = explode('/', $title->getDBkey().'/', 2);
207208 if ($par) $title = Title::newFromText($par);
208209 elseif ($wgRequest->getVal('target')) $title = Title::newFromText($wgRequest->getVal('target'));
209210 elseif ($wgRequest->getVal('oldtitle')) $title = Title::newFromText($wgRequest->getVal('oldtitle'));
210 - } else $title = $wgTitle;
211 - if (!is_object($title)) return true; # If still no usable title bail
 211+ }
 212+ if (!is_object($title)) return true; # If still no usable title bail
212213
213214 $this->info['LS'] = array(); # security info for rules from LocalSettings ($wgPageRestrictions)
214215 $this->info['PR'] = array(); # security info for rules from protect tab

Status & tagging log