r62543 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62542‎ | r62543 | r62544 >
Date:20:23, 15 February 2010
Author:catrope
Status:ok
Tags:
Comment:
wmf-deployment: MFT r62540
Modified paths:
  • /branches/wmf-deployment/includes/api (modified) (history)
  • /branches/wmf-deployment/includes/api/ApiMain.php (modified) (history)
  • /branches/wmf-deployment/includes/api/ApiOpenSearch.php (modified) (history)
  • /branches/wmf-deployment/includes/api/ApiQueryBacklinks.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/includes/api/ApiOpenSearch.php
@@ -42,16 +42,15 @@
4343 }
4444
4545 public function execute() {
46 - global $wgEnableMWSuggest;
 46+ global $wgEnableMWSuggest, $wgSearchSuggestCacheExpiry, $wgGroupPermissions, $wgUser;
4747 $params = $this->extractRequestParams();
4848 $search = $params['search'];
4949 $limit = $params['limit'];
5050 $namespaces = $params['namespace'];
5151 $suggest = $params['suggest'];
5252
53 - // $wgEnableMWSuggest hit incoming when $wgEnableMWSuggest is
54 - // disabled
55 - if( $suggest && !$wgEnableMWSuggest )
 53+ // MWSuggest or similar hit, or hit without read rights
 54+ if ( ( $suggest && !$wgEnableMWSuggest ) || ( !$wgGroupPermissions['*']['read'] && !$wgUser->isAllowed( 'read' ) ) )
5655 $srchres = array();
5756 else {
5857 // Open search results may be stored for a very long
@@ -108,4 +107,8 @@
109108 public function getVersion() {
110109 return __CLASS__ . ': $Id$';
111110 }
 111+
 112+ public function isReadMode() {
 113+ return false;
 114+ }
112115 }
Property changes on: branches/wmf-deployment/includes/api/ApiMain.php
___________________________________________________________________
Modified: svn:mergeinfo
113116 Merged /trunk/phase3/includes/api/ApiMain.php:r62540
Property changes on: branches/wmf-deployment/includes/api/ApiQueryBacklinks.php
___________________________________________________________________
Modified: svn:mergeinfo
114117 Merged /trunk/phase3/includes/api/ApiQueryBacklinks.php:r62540
Property changes on: branches/wmf-deployment/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
115118 Merged /trunk/phase3/includes/api:r62540

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62540API: Optimize read rights check in opensearch so $wgUser doesn't get unstubbe...catrope20:20, 15 February 2010

Status & tagging log