r102659 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102658‎ | r102659 | r102660 >
Date:14:58, 10 November 2011
Author:yaron
Status:deferred
Tags:
Comment:
Follow-up to r102365 - stricter comparators indirectly caused a problem when using Special:RunQuery; this has now been fixed
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -366,6 +366,8 @@
367367 // just use the name of the actual page we're on.
368368 global $wgTitle;
369369 $this->mPageTitle = $wgTitle;
 370+ } elseif ( $is_query ) {
 371+ $this->mPageTitle = Title::newFromText( 'RunQuery dummy title' );
370372 } elseif ( $page_name === '' ) {
371373 $this->mPageTitle = Title::newFromText(
372374 $wgRequest->getVal( 'namespace' ) . ":Semantic Forms permissions test" );
@@ -383,10 +385,12 @@
384386 // "$wgEmailConfirmToEdit = true;". Instead, we'll just get the
385387 // permission errors from the start, and use those to determine whether
386388 // the page is editable.
387 - //$userCanEditPage = ( $wgUser->isAllowed( 'edit' ) && $this->mPageTitle->userCan( 'edit' ) );
388 - $permissionErrors = $this->mPageTitle->getUserPermissionsErrors( 'edit', $wgUser );
389 - $userCanEditPage = count( $permissionErrors ) == 0;
390 - wfRunHooks( 'sfUserCanEditPage', array( $this->mPageTitle, &$userCanEditPage ) );
 389+ if ( !$is_query ) {
 390+ //$userCanEditPage = ( $wgUser->isAllowed( 'edit' ) && $this->mPageTitle->userCan( 'edit' ) );
 391+ $permissionErrors = $this->mPageTitle->getUserPermissionsErrors( 'edit', $wgUser );
 392+ $userCanEditPage = count( $permissionErrors ) == 0;
 393+ wfRunHooks( 'sfUserCanEditPage', array( $this->mPageTitle, &$userCanEditPage ) );
 394+ }
391395 $form_text = "";
392396 if ( $userCanEditPage || $is_query ) {
393397 $form_is_disabled = false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102365strict comparators for empty stringsjeroendedauw02:25, 8 November 2011