mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Merge pull request #1347 from powelski/resolve-1272
Escape HTML for .txt contents
This commit is contained in:
commit
d537cef720
@ -69,10 +69,17 @@ class Content extends CmsCompoundObject
|
|||||||
|
|
||||||
protected function parseMarkup()
|
protected function parseMarkup()
|
||||||
{
|
{
|
||||||
$result = $this->markup;
|
$extension = strtolower(File::extension($this->fileName));
|
||||||
|
|
||||||
if (strtolower(File::extension($this->fileName)) == 'md') {
|
switch ($extension) {
|
||||||
$result = Markdown::parse($this->markup);
|
case 'txt':
|
||||||
|
$result = htmlspecialchars($this->markup);
|
||||||
|
break;
|
||||||
|
case 'md':
|
||||||
|
$result = Markdown::parse($this->markup);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$result = $this->markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user