mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-18 16:41:08 +00:00
5377ebe819
composer: * mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0 npm: * postcss: 7.0.35 → 7.0.36 * https://npmjs.com/advisories/1693 (CVE-2021-23368) Change-Id: I2b382f3bb236fb44eb24c6a257b13b8fd886541c
28 lines
641 B
PHP
28 lines
641 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter\EditBox;
|
|
|
|
use Xml;
|
|
|
|
/**
|
|
* Class responsible for building a plain text filter edit box
|
|
*/
|
|
class PlainEditBoxBuiler extends EditBoxBuilder {
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function getEditBox( string $rules, bool $isUserAllowed, bool $externalForm ): string {
|
|
$rules = rtrim( $rules ) . "\n";
|
|
// Rules are in English
|
|
$editorAttribs = [ 'dir' => 'ltr' ];
|
|
if ( !$isUserAllowed ) {
|
|
$editorAttribs['readonly'] = 'readonly';
|
|
}
|
|
if ( $externalForm ) {
|
|
$editorAttribs['form'] = 'wpFilterForm';
|
|
}
|
|
return Xml::textarea( 'wpFilterRules', $rules, 40, 15, $editorAttribs );
|
|
}
|
|
|
|
}
|