r88529 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88528‎ | r88529 | r88530 >
Date:18:53, 21 May 2011
Author:robin
Status:ok
Tags:
Comment:
Make onRcQuery() use buildLike() (the OR ... is not needed actually)
Modified paths:
  • /trunk/extensions/WikimediaIncubator/TestWikiRC.php (modified) (history)
  • /trunk/extensions/WikimediaIncubator/WikimediaIncubator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php
@@ -1,7 +1,9 @@
22 <?php
33 if ( !defined( 'MEDIAWIKI' ) ) { die( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); }
44 /**
5 - * An extension that adds test wiki features (such as a preference, recent changes for a test wiki, ...) specifically for the Wikimedia Incubator
 5+ * An extension that adds features (such as a preference, recent changes, ...)
 6+ * for a test wiki system (i.e. incubated wikis inside one actual wiki)
 7+ * mainly intended for the Wikimedia Incubator
68 *
79 * @file
810 * @ingroup Extensions
@@ -11,7 +13,7 @@
1214 'path' => __FILE__,
1315 'name' => 'Wikimedia Incubator',
1416 'author' => 'SPQRobin',
15 - 'version' => '3.0',
 17+ 'version' => '3.0.1',
1618 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator',
1719 'descriptionmsg' => 'wminc-desc',
1820 );
Index: trunk/extensions/WikimediaIncubator/TestWikiRC.php
@@ -8,7 +8,7 @@
99 global $wgUser, $wgRequest, $wmincPref, $wmincProjectSite, $wmincTestWikiNamespaces;
1010 $projectvalue = strtolower( $wgRequest->getVal( 'rc-testwiki-project', $wgUser->getOption($wmincPref . '-project') ) );
1111 $codevalue = strtolower( $wgRequest->getVal( 'rc-testwiki-code', $wgUser->getOption($wmincPref . '-code') ) );
12 - $fullprefix = IncubatorTest::displayPrefix( $projectvalue, $codevalue );
 12+ $prefix = IncubatorTest::displayPrefix( $projectvalue, $codevalue );
1313 $opts->add( 'rc-testwiki-project', false );
1414 $opts->setValue( 'rc-testwiki-project', $projectvalue );
1515 $opts->add( 'rc-testwiki-code', false );
@@ -18,16 +18,16 @@
1919 return true;
2020 } elseif ( $projectvalue == $wmincProjectSite['short'] ) {
2121 // If project site is selected, display all changes except test wiki changes
22 - $conds[] = 'rc_title not like \'W_/%%\' OR \'W_/%%/%%\'';
23 - return true;
 22+ $dbr = wfGetDB( DB_SLAVE );
 23+ $conds[] = 'rc_title NOT ' . $dbr->buildLike( 'W', $dbr->anyChar(), '/', $dbr->anyString() );
2424 } else {
25 - // Else, display changes to the selected test wiki (in main, template and category namespace)
 25+ // Else, display changes to the selected test wiki in the appropriate namespaces
2626 $dbr = wfGetDB( DB_SLAVE );
2727 $conds['rc_namespace'] = $wmincTestWikiNamespaces;
28 - $conds[] = 'rc_title ' . $dbr->buildLike( $fullprefix . '/', $dbr->anyString() ) .
29 - ' OR rc_title = ' . $dbr->addQuotes( $fullprefix );
30 - return true;
 28+ $conds[] = 'rc_title ' . $dbr->buildLike( $prefix . '/', $dbr->anyString() ) .
 29+ ' OR rc_title = ' . $dbr->addQuotes( $prefix );
3130 }
 31+ return true;
3232 }
3333
3434 static function onRcForm( &$items, $opts ) {

Status & tagging log