diff --git a/modules/cms/classes/Content.php b/modules/cms/classes/Content.php index 429b24d96..7a5f75983 100644 --- a/modules/cms/classes/Content.php +++ b/modules/cms/classes/Content.php @@ -69,10 +69,17 @@ class Content extends CmsCompoundObject protected function parseMarkup() { - $result = $this->markup; + $extension = strtolower(File::extension($this->fileName)); - if (strtolower(File::extension($this->fileName)) == 'md') { - $result = Markdown::parse($this->markup); + switch ($extension) { + case 'txt': + $result = htmlspecialchars($this->markup); + break; + case 'md': + $result = Markdown::parse($this->markup); + break; + default: + $result = $this->markup; } return $result;