Fix undeclared variable

The variable was declared in the "if" branch but also used in the "else"
one. This caused the rules textarea to not have the readonly attribute
if the user wasn't allowed and CodeEditor wasn't installed.

Change-Id: I2bf69dc0f2d24efac41d1ac6100ed7e286e3afa4
This commit is contained in:
Daimona Eaytoy 2018-04-30 15:55:10 +02:00
parent b18e763c7e
commit 99f32a1408

View file

@ -90,6 +90,7 @@ abstract class AbuseFilterView extends ContextSource {
}
$rules = rtrim( $rules ) . "\n";
$canEdit = $this->canEdit();
if ( ExtensionRegistry::getInstance()->isLoaded( 'CodeEditor' ) ) {
$editorAttrib['name'] = 'wpAceFilterEditor';
@ -115,7 +116,6 @@ abstract class AbuseFilterView extends ContextSource {
}
$rulesContainer .= Xml::textarea( $textName, $rules, 40, 15, $textareaAttribs );
$canEdit = $this->canEdit();
$editorConfig = AbuseFilter::getAceConfig( $canEdit );
// Add Ace configuration variable