r106010 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106009‎ | r106010 | r106011 >
Date:11:05, 13 December 2011
Author:robin
Status:ok
Tags:
Comment:
update all core usage of deprecated Title::userCanRead()
Modified paths:
  • /trunk/phase3/img_auth.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuery.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialExport.php (modified) (history)
  • /trunk/phase3/thumb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -1534,7 +1534,7 @@
15351535 protected function showCustomIntro() {
15361536 if ( $this->editintro ) {
15371537 $title = Title::newFromText( $this->editintro );
1538 - if ( $title instanceof Title && $title->exists() && $title->userCanRead() ) {
 1538+ if ( $title instanceof Title && $title->exists() && $title->userCan( 'read' ) ) {
15391539 global $wgOut;
15401540 // Added using template syntax, to take <noinclude>'s into account.
15411541 $wgOut->addWikiTextTitleTidy( '{{:' . $title->getFullText() . '}}', $this->mTitle );
Index: trunk/phase3/includes/OutputPage.php
@@ -2112,7 +2112,7 @@
21132113
21142114 # Don't return to a page the user can't read otherwise
21152115 # we'll end up in a pointless loop
2116 - if ( $displayReturnto && $displayReturnto->userCanRead() ) {
 2116+ if ( $displayReturnto && $displayReturnto->userCan( 'read' ) ) {
21172117 $this->returnToMain( null, $displayReturnto );
21182118 }
21192119 } else {
Index: trunk/phase3/includes/api/ApiQuery.php
@@ -483,7 +483,7 @@
484484 $titles = $pageSet->getGoodTitles();
485485 if ( count( $titles ) ) {
486486 foreach ( $titles as $title ) {
487 - if ( $title->userCanRead() ) {
 487+ if ( $title->userCan( 'read' ) ) {
488488 $exportTitles[] = $title;
489489 }
490490 }
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -191,7 +191,7 @@
192192 if ( isset( $prop['content'] ) || !is_null( $this->difftotext ) ) {
193193 // For each page we will request, the user must have read rights for that page
194194 foreach ( $pageSet->getGoodTitles() as $title ) {
195 - if ( !$title->userCanRead() ) {
 195+ if ( !$title->userCan( 'read' ) ) {
196196 $this->dieUsage(
197197 'The current user is not allowed to read ' . $title->getPrefixedText(),
198198 'accessdenied' );
Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -378,7 +378,7 @@
379379 $pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
380380 $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ), PROTO_CURRENT );
381381 }
382 - if ( $this->fld_readable && $title->userCanRead() ) {
 382+ if ( $this->fld_readable && $title->userCan( 'read' ) ) {
383383 $pageInfo['readable'] = '';
384384 }
385385
Index: trunk/phase3/includes/specials/SpecialExport.php
@@ -326,7 +326,7 @@
327327 if( is_null( $title ) ) {
328328 continue; #TODO: perhaps output an <error> tag or something.
329329 }
330 - if( !$title->userCanRead() ) {
 330+ if( !$title->userCan( 'read' ) ) {
331331 continue; #TODO: perhaps output an <error> tag or something.
332332 }
333333
Index: trunk/phase3/img_auth.php
@@ -116,8 +116,8 @@
117117 }
118118
119119 // Check user authorization for this title
120 - // UserCanRead Checks Whitelist too
121 - if ( !$title->userCanRead() ) {
 120+ // Checks Whitelist too
 121+ if ( !$title->userCan( 'read' ) ) {
122122 wfForbidden( 'img-auth-accessdenied', 'img-auth-noread', $name );
123123 return;
124124 }
Index: trunk/phase3/thumb.php
@@ -118,7 +118,7 @@
119119
120120 // Check permissions if there are read restrictions
121121 if ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) {
122 - if ( !$img->getTitle()->userCanRead() ) {
 122+ if ( !$img->getTitle()->userCan( 'read' ) ) {
123123 wfThumbError( 403, 'Access denied. You do not have permission to access ' .
124124 'the source file.' );
125125 wfProfileOut( __METHOD__ );

Status & tagging log