[ci skip] Manually apply #2162, #2163
diff --git a/system/core/Output.php b/system/core/Output.php
index cf5178a..a208414 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -772,7 +772,7 @@
 					$output = str_replace($codes_messed[0], $codes_clean[0], $output);
 				}
 
-				if ( ! empty($codes_clean))
+				if ( ! empty($textareas_clean))
 				{
 					preg_match_all('{<textarea.+</textarea>}msU', $output, $textareas_messed);
 					$output = str_replace($textareas_messed[0], $textareas_clean[0], $output);