mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Phase 1: Replace Parsedown with league/commonmark (4 call sites)
This commit is contained in:
@@ -12,6 +12,8 @@ require_once __DIR__ . '/../../src/AdminAuth.php';
|
||||
AdminAuth::requireLogin();
|
||||
require_once __DIR__ . '/../../src/Database.php';
|
||||
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
if (empty($_SESSION['csrf_token'])) {
|
||||
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||
}
|
||||
@@ -91,10 +93,8 @@ function renderCollapsed(Database $db, string $key): void
|
||||
|
||||
$mdHtml = '';
|
||||
if ($hasContent) {
|
||||
require_once APP_ROOT . '/src/Parsedown.php';
|
||||
$pd = new Parsedown();
|
||||
$pd->setSafeMode(true);
|
||||
$mdHtml = $pd->text($content);
|
||||
$converter = new CommonMarkConverter(['html_input' => 'strip']);
|
||||
$mdHtml = $converter->convert($content)->getContent();
|
||||
}
|
||||
?>
|
||||
<div class="fhb-inline <?= $enabled ? '' : 'fhb-inline--disabled' ?>" data-key="<?= htmlspecialchars($key) ?>">
|
||||
|
||||
Reference in New Issue
Block a user