r90946 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90945‎ | r90946 | r90947 >
Date:08:33, 28 June 2011
Author:nad
Status:deferred
Tags:
Comment:
remove the legacy defaultread hack as it fails on recent MediaWiki version
Modified paths:
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.php (modified) (history)
  • /trunk/extensions/SimpleSecurity/SimpleSecurity_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSecurity/SimpleSecurity_body.php
@@ -26,10 +26,6 @@
2727 $wgRestrictionTypes, $wgRestrictionLevels, $wgGroupPermissions,
2828 $wgSecurityRenderInfo, $wgSecurityAllowUnreadableLinks, $wgSecurityGroupsArticle;
2929
30 - # $wgGroupPermissions has to have its default read entry removed because Title::userCanRead checks it directly
31 - if ( $this->default_read = ( isset( $wgGroupPermissions['*']['read'] ) && $wgGroupPermissions['*']['read'] ) )
32 - $wgGroupPermissions['*']['read'] = false;
33 -
3430 # Add our hooks
3531 $wgHooks['UserGetRights'][] = $this;
3632 $wgHooks['ImgAuthBeforeStream'][] = $this;
@@ -170,14 +166,8 @@
171167 * Check if image is accessible by current user when using img_auth
172168 */
173169 public function onImgAuthBeforeStream( &$title, &$path, &$name, &$result ) {
174 - global $wgUser, $wgGroupPermissions;
 170+ global $wgUser;
175171
176 - # Put the anon read right back in $wgGroupPermissions if it was there initially
177 - # - it had to be removed because Title::userCanRead short-circuits with it
178 - if ( $this->default_read ) {
179 - $wgGroupPermissions['*']['read'] = true;
180 - }
181 -
182172 if ( !$this->userCanReadTitle( $wgUser, $title, $error )) {
183173 $result = array('img-auth-accessdenied', 'img-auth-noread', $name);
184174 return false;
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php
@@ -22,7 +22,7 @@
2323 * @copyright © 2007-2011 Aran Dunkley
2424 * @license GNU General Public Licence 2.0 or later
2525 */
26 -define( 'SIMPLESECURITY_VERSION', '5.0.1, 2011-06-25' );
 26+define( 'SIMPLESECURITY_VERSION', '5.0.3, 2011-06-28' );
2727
2828 # Load the SimpleSecurity class and messages
2929 $dir = dirname( __FILE__ ) . '/';

Status & tagging log