From 99f32a14088897d436a147293beec163bf9aecc3 Mon Sep 17 00:00:00 2001 From: Daimona Eaytoy Date: Mon, 30 Apr 2018 15:55:10 +0200 Subject: [PATCH] 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 --- includes/Views/AbuseFilterView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Views/AbuseFilterView.php b/includes/Views/AbuseFilterView.php index 415023576..672b9939d 100644 --- a/includes/Views/AbuseFilterView.php +++ b/includes/Views/AbuseFilterView.php @@ -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