2009-01-28 23:54:41 +00:00
|
|
|
<?php
|
|
|
|
|
2020-11-29 10:53:29 +00:00
|
|
|
namespace MediaWiki\Extension\AbuseFilter\View;
|
|
|
|
|
|
|
|
use HTMLForm;
|
|
|
|
use IContextSource;
|
2021-02-08 12:34:18 +00:00
|
|
|
use LogEventsList;
|
|
|
|
use LogPage;
|
2021-01-03 11:12:16 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\AbuseFilterChangesList;
|
2020-10-23 14:19:02 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
|
2021-02-01 15:47:46 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\EditBox\EditBoxBuilderFactory;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\EditBox\EditBoxField;
|
2020-10-23 14:19:02 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\Parser\ParserFactory as AfParserFactory;
|
2021-01-03 13:10:20 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\VariableGenerator\VariableGeneratorFactory;
|
2020-10-23 14:19:02 +00:00
|
|
|
use MediaWiki\Linker\LinkRenderer;
|
2021-02-08 12:34:18 +00:00
|
|
|
use MediaWiki\Revision\RevisionRecord;
|
2020-11-29 10:53:29 +00:00
|
|
|
use RecentChange;
|
|
|
|
use Title;
|
2020-01-11 17:05:30 +00:00
|
|
|
|
2009-01-29 22:44:31 +00:00
|
|
|
class AbuseFilterViewTestBatch extends AbuseFilterView {
|
2018-11-08 14:34:32 +00:00
|
|
|
/**
|
|
|
|
* @var int The limit of changes to test, hard coded for now
|
|
|
|
*/
|
2015-09-28 18:03:35 +00:00
|
|
|
protected static $mChangeLimit = 100;
|
2009-10-07 13:57:06 +00:00
|
|
|
|
2018-11-08 14:34:32 +00:00
|
|
|
/**
|
|
|
|
* @var bool Whether to show changes that don't trigger the specified pattern
|
|
|
|
*/
|
|
|
|
public $mShowNegative;
|
|
|
|
/**
|
|
|
|
* @var string The start time of the lookup period
|
|
|
|
*/
|
|
|
|
public $mTestPeriodStart;
|
|
|
|
/**
|
|
|
|
* @var string The end time of the lookup period
|
|
|
|
*/
|
|
|
|
public $mTestPeriodEnd;
|
|
|
|
/**
|
|
|
|
* @var string The page of which edits we're interested in
|
|
|
|
*/
|
|
|
|
public $mTestPage;
|
|
|
|
/**
|
|
|
|
* @var string The user whose actions we want to test
|
|
|
|
*/
|
|
|
|
public $mTestUser;
|
|
|
|
/**
|
|
|
|
* @var bool Whether to exclude bot edits
|
|
|
|
*/
|
|
|
|
public $mExcludeBots;
|
|
|
|
/**
|
|
|
|
* @var string The action (performed by the user) we want to search for
|
|
|
|
*/
|
|
|
|
public $mTestAction;
|
2019-12-16 11:17:49 +00:00
|
|
|
/**
|
|
|
|
* @var string The text of the rule to test changes against
|
|
|
|
*/
|
|
|
|
private $testPattern;
|
2020-10-23 14:19:02 +00:00
|
|
|
/**
|
|
|
|
* @var EditBoxBuilderFactory
|
|
|
|
*/
|
|
|
|
private $boxBuilderFactory;
|
|
|
|
/**
|
|
|
|
* @var AfParserFactory
|
|
|
|
*/
|
|
|
|
private $parserFactory;
|
2021-01-03 13:10:20 +00:00
|
|
|
/**
|
|
|
|
* @var VariableGeneratorFactory
|
|
|
|
*/
|
|
|
|
private $varGeneratorFactory;
|
2020-10-23 14:19:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param AbuseFilterPermissionManager $afPermManager
|
|
|
|
* @param EditBoxBuilderFactory $boxBuilderFactory
|
|
|
|
* @param AfParserFactory $parserFactory
|
2021-01-03 13:10:20 +00:00
|
|
|
* @param VariableGeneratorFactory $varGeneratorFactory
|
2020-10-23 14:19:02 +00:00
|
|
|
* @param IContextSource $context
|
|
|
|
* @param LinkRenderer $linkRenderer
|
|
|
|
* @param string $basePageName
|
|
|
|
* @param array $params
|
|
|
|
*/
|
|
|
|
public function __construct(
|
|
|
|
AbuseFilterPermissionManager $afPermManager,
|
|
|
|
EditBoxBuilderFactory $boxBuilderFactory,
|
|
|
|
AfParserFactory $parserFactory,
|
2021-01-03 13:10:20 +00:00
|
|
|
VariableGeneratorFactory $varGeneratorFactory,
|
2020-10-23 14:19:02 +00:00
|
|
|
IContextSource $context,
|
|
|
|
LinkRenderer $linkRenderer,
|
|
|
|
string $basePageName,
|
|
|
|
array $params
|
|
|
|
) {
|
|
|
|
parent::__construct( $afPermManager, $context, $linkRenderer, $basePageName, $params );
|
|
|
|
$this->boxBuilderFactory = $boxBuilderFactory;
|
|
|
|
$this->parserFactory = $parserFactory;
|
2021-01-03 13:10:20 +00:00
|
|
|
$this->varGeneratorFactory = $varGeneratorFactory;
|
2020-10-23 14:19:02 +00:00
|
|
|
}
|
2013-10-15 13:22:05 +00:00
|
|
|
|
2018-04-04 21:14:25 +00:00
|
|
|
/**
|
|
|
|
* Shows the page
|
|
|
|
*/
|
|
|
|
public function show() {
|
2011-11-16 05:34:24 +00:00
|
|
|
$out = $this->getOutput();
|
2009-10-07 13:57:06 +00:00
|
|
|
|
2021-02-19 17:50:38 +00:00
|
|
|
if ( !$this->afPermManager->canUseTestTools( $this->getUser() ) ) {
|
|
|
|
// TODO: the message still refers to the old rights
|
2018-05-04 19:56:45 +00:00
|
|
|
$out->addWikiMsg( 'abusefilter-mustviewprivateoredit' );
|
2009-03-31 15:13:26 +00:00
|
|
|
return;
|
|
|
|
}
|
2009-01-28 23:54:41 +00:00
|
|
|
|
|
|
|
$this->loadParameters();
|
2009-10-07 13:57:06 +00:00
|
|
|
|
2012-09-02 11:07:02 +00:00
|
|
|
$out->setPageTitle( $this->msg( 'abusefilter-test' ) );
|
2020-10-03 13:05:20 +00:00
|
|
|
$out->addHelpLink( 'Extension:AbuseFilter/Rules format' );
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addWikiMsg( 'abusefilter-test-intro', self::$mChangeLimit );
|
2018-03-15 17:22:37 +00:00
|
|
|
$out->enableOOUI();
|
2009-01-28 23:54:41 +00:00
|
|
|
|
2020-10-23 14:19:02 +00:00
|
|
|
$boxBuilder = $this->boxBuilderFactory->newEditBoxBuilder( $this, $this->getUser(), $out );
|
2020-11-24 12:16:41 +00:00
|
|
|
|
2021-02-01 15:47:46 +00:00
|
|
|
$rulesFields = [
|
|
|
|
'rules' => [
|
|
|
|
'section' => 'abusefilter-test-rules-section',
|
|
|
|
'class' => EditBoxField::class,
|
|
|
|
'html' => $boxBuilder->buildEditBox(
|
|
|
|
$this->testPattern,
|
|
|
|
true,
|
|
|
|
true,
|
|
|
|
false
|
|
|
|
) . $this->buildFilterLoader()
|
|
|
|
]
|
|
|
|
];
|
2009-10-07 13:57:06 +00:00
|
|
|
|
2018-03-15 17:22:37 +00:00
|
|
|
$RCMaxAge = $this->getConfig()->get( 'RCMaxAge' );
|
|
|
|
$min = wfTimestamp( TS_ISO_8601, time() - $RCMaxAge );
|
|
|
|
$max = wfTimestampNow();
|
2009-10-07 13:57:06 +00:00
|
|
|
|
2021-02-01 15:47:46 +00:00
|
|
|
$optionsFields = [];
|
|
|
|
$optionsFields['wpTestAction'] = [
|
2018-05-01 09:27:00 +00:00
|
|
|
'name' => 'wpTestAction',
|
|
|
|
'type' => 'select',
|
|
|
|
'label-message' => 'abusefilter-test-action',
|
|
|
|
'options' => [
|
|
|
|
$this->msg( 'abusefilter-test-search-type-all' )->text() => 0,
|
|
|
|
$this->msg( 'abusefilter-test-search-type-edit' )->text() => 'edit',
|
|
|
|
$this->msg( 'abusefilter-test-search-type-move' )->text() => 'move',
|
|
|
|
$this->msg( 'abusefilter-test-search-type-delete' )->text() => 'delete',
|
2018-07-11 23:54:48 +00:00
|
|
|
$this->msg( 'abusefilter-test-search-type-createaccount' )->text() => 'createaccount',
|
|
|
|
$this->msg( 'abusefilter-test-search-type-upload' )->text() => 'upload'
|
2018-05-01 09:27:00 +00:00
|
|
|
]
|
|
|
|
];
|
2021-02-01 15:47:46 +00:00
|
|
|
$optionsFields['wpTestUser'] = [
|
2018-03-15 17:22:37 +00:00
|
|
|
'name' => 'wpTestUser',
|
|
|
|
'type' => 'user',
|
|
|
|
'ipallowed' => true,
|
|
|
|
'label-message' => 'abusefilter-test-user',
|
|
|
|
'default' => $this->mTestUser
|
|
|
|
];
|
2021-02-01 15:47:46 +00:00
|
|
|
$optionsFields['wpExcludeBots'] = [
|
2018-05-07 15:25:40 +00:00
|
|
|
'name' => 'wpExcludeBots',
|
|
|
|
'type' => 'check',
|
|
|
|
'label-message' => 'abusefilter-test-nobots',
|
|
|
|
'default' => $this->mExcludeBots
|
|
|
|
];
|
2021-02-01 15:47:46 +00:00
|
|
|
$optionsFields['wpTestPeriodStart'] = [
|
2018-03-15 17:22:37 +00:00
|
|
|
'name' => 'wpTestPeriodStart',
|
|
|
|
'type' => 'datetime',
|
|
|
|
'label-message' => 'abusefilter-test-period-start',
|
|
|
|
'default' => $this->mTestPeriodStart,
|
|
|
|
'min' => $min,
|
|
|
|
'max' => $max
|
|
|
|
];
|
2021-02-01 15:47:46 +00:00
|
|
|
$optionsFields['wpTestPeriodEnd'] = [
|
2018-03-15 17:22:37 +00:00
|
|
|
'name' => 'wpTestPeriodEnd',
|
|
|
|
'type' => 'datetime',
|
|
|
|
'label-message' => 'abusefilter-test-period-end',
|
|
|
|
'default' => $this->mTestPeriodEnd,
|
|
|
|
'min' => $min,
|
|
|
|
'max' => $max
|
|
|
|
];
|
2021-02-01 15:47:46 +00:00
|
|
|
$optionsFields['wpTestPage'] = [
|
2018-03-15 17:22:37 +00:00
|
|
|
'name' => 'wpTestPage',
|
|
|
|
'type' => 'title',
|
|
|
|
'label-message' => 'abusefilter-test-page',
|
|
|
|
'default' => $this->mTestPage,
|
2018-05-10 20:20:05 +00:00
|
|
|
'creatable' => true,
|
|
|
|
'required' => false
|
2018-03-15 17:22:37 +00:00
|
|
|
];
|
2021-02-01 15:47:46 +00:00
|
|
|
$optionsFields['wpShowNegative'] = [
|
2018-03-15 17:22:37 +00:00
|
|
|
'name' => 'wpShowNegative',
|
|
|
|
'type' => 'check',
|
|
|
|
'label-message' => 'abusefilter-test-shownegative',
|
|
|
|
'selected' => $this->mShowNegative
|
|
|
|
];
|
2021-04-30 18:54:17 +00:00
|
|
|
array_walk( $optionsFields, static function ( &$el ) {
|
2021-02-01 15:47:46 +00:00
|
|
|
$el['section'] = 'abusefilter-test-options-section';
|
|
|
|
} );
|
|
|
|
$allFields = array_merge( $rulesFields, $optionsFields );
|
2009-01-28 23:54:41 +00:00
|
|
|
|
2021-02-01 15:47:46 +00:00
|
|
|
HTMLForm::factory( 'ooui', $allFields, $this->getContext() )
|
2021-07-02 10:10:30 +00:00
|
|
|
->setTitle( $this->getTitle( 'test' ) )
|
2018-03-15 17:22:37 +00:00
|
|
|
->setId( 'wpFilterForm' )
|
2021-02-01 15:47:46 +00:00
|
|
|
->setWrapperLegendMsg( 'abusefilter-test-legend' )
|
2018-03-15 17:22:37 +00:00
|
|
|
->setSubmitTextMsg( 'abusefilter-test-submit' )
|
|
|
|
->setMethod( 'post' )
|
2018-04-29 17:52:45 +00:00
|
|
|
->prepareForm()
|
2021-02-01 15:47:46 +00:00
|
|
|
->displayForm( false );
|
2009-01-28 23:54:41 +00:00
|
|
|
|
2011-11-16 05:34:24 +00:00
|
|
|
if ( $this->getRequest()->wasPosted() ) {
|
2009-01-28 23:54:41 +00:00
|
|
|
$this->doTest();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-13 08:19:09 +00:00
|
|
|
/**
|
2018-10-03 12:02:00 +00:00
|
|
|
* Loads the revisions and checks the given syntax against them
|
2017-07-13 08:19:09 +00:00
|
|
|
*/
|
2018-04-04 21:14:25 +00:00
|
|
|
public function doTest() {
|
2009-01-28 23:54:41 +00:00
|
|
|
// Quick syntax check.
|
2011-11-16 05:34:24 +00:00
|
|
|
$out = $this->getOutput();
|
2020-10-23 14:19:02 +00:00
|
|
|
$parser = $this->parserFactory->newParser();
|
2020-09-19 22:30:14 +00:00
|
|
|
|
2020-12-18 16:53:36 +00:00
|
|
|
if ( $parser->checkSyntax( $this->testPattern )->getResult() !== true ) {
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addWikiMsg( 'abusefilter-test-syntaxerr' );
|
2009-01-28 23:54:41 +00:00
|
|
|
return;
|
|
|
|
}
|
2009-01-29 22:44:31 +00:00
|
|
|
|
2021-04-19 05:18:47 +00:00
|
|
|
$dbr = wfGetDB( DB_REPLICA );
|
|
|
|
$rcQuery = RecentChange::getQueryInfo();
|
2017-07-13 08:19:09 +00:00
|
|
|
$conds = [];
|
2018-03-09 21:23:38 +00:00
|
|
|
|
|
|
|
if ( (string)$this->mTestUser !== '' ) {
|
2021-04-19 05:18:47 +00:00
|
|
|
$conds[$rcQuery['fields']['rc_user_text']] = $this->mTestUser;
|
2018-03-09 21:23:38 +00:00
|
|
|
}
|
2009-01-29 22:44:31 +00:00
|
|
|
|
2009-10-07 13:57:06 +00:00
|
|
|
if ( $this->mTestPeriodStart ) {
|
|
|
|
$conds[] = 'rc_timestamp >= ' .
|
2009-02-07 09:34:11 +00:00
|
|
|
$dbr->addQuotes( $dbr->timestamp( strtotime( $this->mTestPeriodStart ) ) );
|
2009-01-29 22:44:31 +00:00
|
|
|
}
|
2009-10-07 13:57:06 +00:00
|
|
|
if ( $this->mTestPeriodEnd ) {
|
|
|
|
$conds[] = 'rc_timestamp <= ' .
|
2009-02-07 09:34:11 +00:00
|
|
|
$dbr->addQuotes( $dbr->timestamp( strtotime( $this->mTestPeriodEnd ) ) );
|
2009-01-29 22:44:31 +00:00
|
|
|
}
|
2009-10-07 13:57:06 +00:00
|
|
|
if ( $this->mTestPage ) {
|
2009-04-23 04:30:17 +00:00
|
|
|
$title = Title::newFromText( $this->mTestPage );
|
2014-01-04 03:03:59 +00:00
|
|
|
if ( $title instanceof Title ) {
|
|
|
|
$conds['rc_namespace'] = $title->getNamespace();
|
|
|
|
$conds['rc_title'] = $title->getDBkey();
|
|
|
|
} else {
|
|
|
|
$out->addWikiMsg( 'abusefilter-test-badtitle' );
|
|
|
|
return;
|
|
|
|
}
|
2009-04-23 04:30:17 +00:00
|
|
|
}
|
2009-01-28 23:54:41 +00:00
|
|
|
|
2018-05-07 15:25:40 +00:00
|
|
|
if ( $this->mExcludeBots ) {
|
|
|
|
$conds['rc_bot'] = 0;
|
|
|
|
}
|
2017-07-13 08:19:09 +00:00
|
|
|
|
2018-08-26 08:34:42 +00:00
|
|
|
$action = $this->mTestAction !== '0' ? $this->mTestAction : false;
|
2018-09-24 12:34:53 +00:00
|
|
|
$conds[] = $this->buildTestConditions( $dbr, $action );
|
2021-03-11 10:50:44 +00:00
|
|
|
$conds = array_merge( $conds, $this->buildVisibilityConditions( $dbr, $this->getAuthority() ) );
|
2018-09-24 12:34:53 +00:00
|
|
|
|
2009-10-07 13:57:06 +00:00
|
|
|
$res = $dbr->select(
|
2017-10-12 19:44:48 +00:00
|
|
|
$rcQuery['tables'],
|
|
|
|
$rcQuery['fields'],
|
2018-05-07 15:25:40 +00:00
|
|
|
$conds,
|
2010-02-13 14:10:36 +00:00
|
|
|
__METHOD__,
|
2017-10-12 19:44:48 +00:00
|
|
|
[ 'LIMIT' => self::$mChangeLimit, 'ORDER BY' => 'rc_timestamp desc' ],
|
|
|
|
$rcQuery['joins']
|
2009-10-07 13:57:06 +00:00
|
|
|
);
|
2009-01-28 23:54:41 +00:00
|
|
|
|
2021-01-31 16:45:12 +00:00
|
|
|
// Get our ChangesList
|
|
|
|
$changesList = new AbuseFilterChangesList( $this->getSkin(), $this->testPattern );
|
|
|
|
// Note, we're initializing some rows that will later be discarded. Hopefully this won't have any overhead.
|
|
|
|
$changesList->initChangesListRows( $res );
|
|
|
|
$output = $changesList->beginRecentChangesList();
|
|
|
|
|
2009-01-28 23:54:41 +00:00
|
|
|
$counter = 1;
|
|
|
|
|
2020-09-20 22:07:57 +00:00
|
|
|
$contextUser = $this->getUser();
|
2020-09-19 22:30:14 +00:00
|
|
|
$parser->toggleConditionLimit( false );
|
2015-09-28 18:03:35 +00:00
|
|
|
foreach ( $res as $row ) {
|
2020-05-28 18:09:17 +00:00
|
|
|
$rc = RecentChange::newFromRow( $row );
|
2021-02-08 12:34:18 +00:00
|
|
|
if ( !$this->mShowNegative ) {
|
|
|
|
$type = (int)$rc->getAttribute( 'rc_type' );
|
|
|
|
$deletedValue = $rc->getAttribute( 'rc_deleted' );
|
|
|
|
if (
|
|
|
|
(
|
|
|
|
$type === RC_LOG &&
|
|
|
|
!LogEventsList::userCanBitfield(
|
|
|
|
$deletedValue,
|
|
|
|
LogPage::SUPPRESSED_ACTION | LogPage::SUPPRESSED_USER,
|
|
|
|
$contextUser
|
|
|
|
)
|
|
|
|
) || (
|
|
|
|
$type !== RC_LOG &&
|
|
|
|
!RevisionRecord::userCanBitfield( $deletedValue, RevisionRecord::SUPPRESSED_ALL, $contextUser )
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
// If the RC is deleted, the user can't see it, and we're only showing matches,
|
|
|
|
// always skip this row. If mShowNegative is true, we can still show the row
|
|
|
|
// because we won't tell whether it matches the given filter.
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-03 13:10:20 +00:00
|
|
|
$varGenerator = $this->varGeneratorFactory->newRCGenerator( $rc, $contextUser );
|
2019-06-25 16:39:57 +00:00
|
|
|
$vars = $varGenerator->getVars();
|
2009-01-28 23:54:41 +00:00
|
|
|
|
2010-08-19 21:12:09 +00:00
|
|
|
if ( !$vars ) {
|
2009-01-28 23:54:41 +00:00
|
|
|
continue;
|
2010-08-19 21:12:09 +00:00
|
|
|
}
|
2009-01-28 23:54:41 +00:00
|
|
|
|
2020-09-19 22:30:14 +00:00
|
|
|
$parser->setVariables( $vars );
|
2019-09-15 15:48:13 +00:00
|
|
|
$result = $parser->checkConditions( $this->testPattern )->getResult();
|
2009-01-28 23:54:41 +00:00
|
|
|
|
2009-10-07 13:57:06 +00:00
|
|
|
if ( $result || $this->mShowNegative ) {
|
2009-01-30 00:54:20 +00:00
|
|
|
// Stash result in RC item
|
|
|
|
$rc->filterResult = $result;
|
2009-01-28 23:54:41 +00:00
|
|
|
$rc->counter = $counter++;
|
|
|
|
$output .= $changesList->recentChangesLine( $rc, false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$output .= $changesList->endRecentChangesList();
|
|
|
|
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addHTML( $output );
|
2009-01-28 23:54:41 +00:00
|
|
|
}
|
|
|
|
|
2018-04-04 21:14:25 +00:00
|
|
|
/**
|
|
|
|
* Loads parameters from request
|
|
|
|
*/
|
|
|
|
public function loadParameters() {
|
2011-11-16 05:34:24 +00:00
|
|
|
$request = $this->getRequest();
|
|
|
|
|
2019-12-16 11:17:49 +00:00
|
|
|
$this->testPattern = $request->getText( 'wpFilterRules' );
|
2011-11-16 05:34:24 +00:00
|
|
|
$this->mShowNegative = $request->getBool( 'wpShowNegative' );
|
|
|
|
$testUsername = $request->getText( 'wpTestUser' );
|
|
|
|
$this->mTestPeriodEnd = $request->getText( 'wpTestPeriodEnd' );
|
|
|
|
$this->mTestPeriodStart = $request->getText( 'wpTestPeriodStart' );
|
|
|
|
$this->mTestPage = $request->getText( 'wpTestPage' );
|
2018-05-07 15:25:40 +00:00
|
|
|
$this->mExcludeBots = $request->getBool( 'wpExcludeBots' );
|
2018-05-01 09:27:00 +00:00
|
|
|
$this->mTestAction = $request->getText( 'wpTestAction' );
|
2009-01-30 19:19:03 +00:00
|
|
|
|
2019-12-16 11:17:49 +00:00
|
|
|
if ( !$this->testPattern
|
2009-10-07 13:57:06 +00:00
|
|
|
&& count( $this->mParams ) > 1
|
2017-07-08 18:49:13 +00:00
|
|
|
&& is_numeric( $this->mParams[1] )
|
|
|
|
) {
|
2017-08-30 02:51:39 +00:00
|
|
|
$dbr = wfGetDB( DB_REPLICA );
|
2019-12-16 11:17:49 +00:00
|
|
|
$this->testPattern = $dbr->selectField( 'abuse_filter',
|
2010-02-13 14:10:36 +00:00
|
|
|
'af_pattern',
|
2017-06-15 14:23:16 +00:00
|
|
|
[ 'af_id' => $this->mParams[1] ],
|
2009-10-07 13:57:06 +00:00
|
|
|
__METHOD__
|
|
|
|
);
|
2009-01-30 19:19:03 +00:00
|
|
|
}
|
2009-10-07 13:57:06 +00:00
|
|
|
|
2009-02-25 02:33:09 +00:00
|
|
|
// Normalise username
|
2017-09-20 14:14:02 +00:00
|
|
|
$userTitle = Title::newFromText( $testUsername, NS_USER );
|
|
|
|
$this->mTestUser = $userTitle ? $userTitle->getText() : null;
|
2009-01-28 23:54:41 +00:00
|
|
|
}
|
2009-01-29 22:44:31 +00:00
|
|
|
}
|