Fix crash and remove debug view

This commit is contained in:
Robert Miles 2018-08-09 00:53:19 -04:00
parent c236caa20d
commit 7b0a6790b4
1 changed files with 3 additions and 5 deletions

View File

@ -9,17 +9,15 @@
$parser = new Mni\FrontYAML\Parser(null, new MDParse());
$filename = 'rfc'.$_GET["number"].'.md';
if (!file_exists($filename)) {
// header("Location: https://rfc.tildeverse.org/");
include 'header.php';
echo "<p>{$filename}</p>";
include 'footer.php';
header("Location: https://rfc.tildeverse.org/");
die();
}
$document = $parser->parse(file_get_contents($filename));
$yml = $document->getYAML();
$content = $document->getContent();
$title = ($yml['title'] ?? 'invalid');
$description = "RFC {$yml['number']}: {$yml['title']} by {htmlspecialchars($yml['author'])}";
$author_san = htmlspecialchars($yml['author']);
$description = "RFC {$yml['number']}: {$yml['title']} by {$author_san}";
include 'header.php';
?>
<h1>RFC <?=$yml['number']?>: <?=$yml['title']?></h1>