no need to include parsedown/Parsedown.php anymore, set flags of htmlspecialchars()

This commit is contained in:
Uwe Steinmann 2018-11-23 21:02:33 +01:00
parent ee7b09d3fb
commit 575355731a

View File

@ -74,14 +74,13 @@ $(document).ready(function() {
<div class="tab-content">
<div class="tab-pane active" id="preview_markdown">
<?php
require_once('parsedown/Parsedown.php');
$Parsedown = new Parsedown();
echo $Parsedown->text(file_get_contents($dms->contentDir . $version->getPath()));
?>
</div>
<div class="tab-pane" id="preview_plain">
<?php
echo "<pre>".htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()))."</pre>";
echo "<pre>".htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()), ENT_SUBSTITUTE)."</pre>";
?>
</div>
</div>
@ -121,7 +120,7 @@ $this->contentHeading(getMLText("content"));
<input type="hidden" name="documentid" value="<?php echo $document->getId(); ?>" />
<textarea id="markdown" name="data" width="100%" rows="20">
<?php
echo htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()));
echo htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()), ENT_SUBSTITUTE);
?>
</textarea>
<button id="update" type="submit" class="btn btn-primary"><i class="icon-save"></i> <?php printMLText("save"); ?></button>