r102183 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102182‎ | r102183 | r102184 >
Date:18:16, 6 November 2011
Author:ialex
Status:ok
Tags:
Comment:
Removed second parameter to Title::userCan() and changed it to quickUserCan() where needed
Modified paths:
  • /trunk/extensions/ForcePreview/ForcePreview.php (modified) (history)
  • /trunk/extensions/ImageTagging/ImageTagPage.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/Hooks.php (modified) (history)
  • /trunk/extensions/LogEntry/LogEntry.page.php (modified) (history)
  • /trunk/extensions/Postcomment/Postcomment.php (modified) (history)
  • /trunk/extensions/ReplaceText/SpecialReplaceText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReplaceText/SpecialReplaceText.php
@@ -163,7 +163,7 @@
164164 }
165165 $new_title = Title::makeTitleSafe( $row->page_namespace, $new_page_name );
166166 $err = $title->isValidMoveOperation( $new_title );
167 - if ( $title->userCan( 'move', true ) && !is_array( $err ) ) {
 167+ if ( $title->userCan( 'move' ) && !is_array( $err ) ) {
168168 $titles_for_move[] = $title;
169169 } else {
170170 $unmoveable_titles[] = $title;
Index: trunk/extensions/Postcomment/Postcomment.php
@@ -127,7 +127,7 @@
128128 return true;
129129 }
130130
131 - if ( !$title->userCan( 'edit', true ) ) {
 131+ if ( !$title->userCan( 'edit' ) ) {
132132 $data .= wfMsgHtml( 'postcomment_discussionprotected' );
133133 return true;
134134 }
Index: trunk/extensions/ImageTagging/ImageTagPage.php
@@ -20,7 +20,7 @@
2121
2222 if (
2323 $wgUser->isAllowed( 'edit' ) &&
24 - $this->mTitle->userCan( 'edit', true ) &&
 24+ $this->mTitle->userCan( 'edit' ) &&
2525 ( $this->mTitle->isProtected( 'edit' ) == false || in_array( 'sysop', $wgUser->getGroups() ) )
2626 )
2727 {
Index: trunk/extensions/ForcePreview/ForcePreview.php
@@ -78,7 +78,7 @@
7979
8080 function efForcePreviewLivePreview( &$out, $sk = null ) {
8181 global $wgUser, $wgRequest, $wgLivePreview, $wgTitle;
82 - if( !$wgLivePreview || !$wgTitle->userCan( 'edit', true ) ) {
 82+ if( !$wgLivePreview || !$wgTitle->userCan( 'edit' ) ) {
8383 return true;
8484 }
8585 if(
Index: trunk/extensions/LogEntry/LogEntry.page.php
@@ -40,7 +40,7 @@
4141 $title = Title::newFromText( $page );
4242
4343 // Check permissions
44 - if( $title && $title->userCan( 'edit', $page ) )
 44+ if( $title && $title->userCan( 'edit' ) )
4545 {
4646 // Get article
4747 $article = new Article( $title, 0 );
Index: trunk/extensions/LiquidThreads/classes/Hooks.php
@@ -769,7 +769,7 @@
770770
771771 $talkpage = $thread->article();
772772
773 - $canRead = $talkpage->getTitle()->userCan( 'read', false );
 773+ $canRead = $talkpage->getTitle()->quickUserCan( 'read' );
774774
775775 if ( $canRead ) {
776776 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r102187* Merged Title::userCanRead() check in Title::getUserPermissionsErrors()...ialex19:59, 6 November 2011

Status & tagging log