From: Robin Pepermans Date: Tue, 13 Dec 2011 11:05:30 +0000 (+0000) Subject: update all core usage of deprecated Title::userCanRead() X-Git-Tag: 1.31.0-rc.0~26008 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=be2de169421dd4676b9046644426a100e19ba3e4;p=lhc%2Fweb%2Fwiklou.git update all core usage of deprecated Title::userCanRead() --- diff --git a/img_auth.php b/img_auth.php index 8b121812f6..968a60e144 100644 --- a/img_auth.php +++ b/img_auth.php @@ -116,8 +116,8 @@ function wfImageAuthMain() { } // Check user authorization for this title - // UserCanRead Checks Whitelist too - if ( !$title->userCanRead() ) { + // Checks Whitelist too + if ( !$title->userCan( 'read' ) ) { wfForbidden( 'img-auth-accessdenied', 'img-auth-noread', $name ); return; } diff --git a/includes/EditPage.php b/includes/EditPage.php index 7b2355a4c8..52831dd176 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1534,7 +1534,7 @@ class EditPage { protected function showCustomIntro() { if ( $this->editintro ) { $title = Title::newFromText( $this->editintro ); - if ( $title instanceof Title && $title->exists() && $title->userCanRead() ) { + if ( $title instanceof Title && $title->exists() && $title->userCan( 'read' ) ) { global $wgOut; // Added using template syntax, to take 's into account. $wgOut->addWikiTextTitleTidy( '{{:' . $title->getFullText() . '}}', $this->mTitle ); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 5d17ec1417..4495714ce0 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2112,7 +2112,7 @@ class OutputPage extends ContextSource { # Don't return to a page the user can't read otherwise # we'll end up in a pointless loop - if ( $displayReturnto && $displayReturnto->userCanRead() ) { + if ( $displayReturnto && $displayReturnto->userCan( 'read' ) ) { $this->returnToMain( null, $displayReturnto ); } } else { diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index b3be027f52..4ac98a3d0a 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -483,7 +483,7 @@ class ApiQuery extends ApiBase { $titles = $pageSet->getGoodTitles(); if ( count( $titles ) ) { foreach ( $titles as $title ) { - if ( $title->userCanRead() ) { + if ( $title->userCan( 'read' ) ) { $exportTitles[] = $title; } } diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index f3442294b3..f0d0faa350 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -378,7 +378,7 @@ class ApiQueryInfo extends ApiQueryBase { $pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ); $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ), PROTO_CURRENT ); } - if ( $this->fld_readable && $title->userCanRead() ) { + if ( $this->fld_readable && $title->userCan( 'read' ) ) { $pageInfo['readable'] = ''; } diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index dcadc41f7f..7323d29b57 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -191,7 +191,7 @@ class ApiQueryRevisions extends ApiQueryBase { if ( isset( $prop['content'] ) || !is_null( $this->difftotext ) ) { // For each page we will request, the user must have read rights for that page foreach ( $pageSet->getGoodTitles() as $title ) { - if ( !$title->userCanRead() ) { + if ( !$title->userCan( 'read' ) ) { $this->dieUsage( 'The current user is not allowed to read ' . $title->getPrefixedText(), 'accessdenied' ); diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index ae7d865393..814d2043bf 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -326,7 +326,7 @@ class SpecialExport extends SpecialPage { if( is_null( $title ) ) { continue; #TODO: perhaps output an tag or something. } - if( !$title->userCanRead() ) { + if( !$title->userCan( 'read' ) ) { continue; #TODO: perhaps output an tag or something. } diff --git a/thumb.php b/thumb.php index f9b58b92bf..74cc71123c 100644 --- a/thumb.php +++ b/thumb.php @@ -118,7 +118,7 @@ function wfStreamThumb( array $params ) { // Check permissions if there are read restrictions if ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) { - if ( !$img->getTitle()->userCanRead() ) { + if ( !$img->getTitle()->userCan( 'read' ) ) { wfThumbError( 403, 'Access denied. You do not have permission to access ' . 'the source file.' ); wfProfileOut( __METHOD__ );