fix dumb
This commit is contained in:
commit
a7a54cf84e
1 changed files with 0 additions and 38 deletions
|
@ -5,41 +5,3 @@ if(preg_match('#^/blog/([0-9]+)$#', $reqPath, $matches) || $reqPath === '/blog.p
|
|||
header('Location: //flash.moe/2020/blog.php?blog=1&p=' . ($matches[1] ?? filter_input(INPUT_GET, 'p', FILTER_SANITIZE_NUMBER_INT) ?? ''));
|
||||
return FM_HIT | 302;
|
||||
}
|
||||
|
||||
if($reqPath === '/blog-elements.json') {
|
||||
if($reqMethod !== 'GET')
|
||||
return FM_ERR | 405;
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
if($reqHead)
|
||||
return FM_HIT;
|
||||
|
||||
$title = filter_input(INPUT_GET, 'title', FILTER_SANITIZE_STRING);
|
||||
|
||||
ob_start();
|
||||
fm_component('header', [
|
||||
'title' => $title ?? '%title%',
|
||||
'external' => true,
|
||||
'styles' => [
|
||||
'//blog.flash.moe/assets/blog.css',
|
||||
],
|
||||
]);
|
||||
$header = ob_get_contents();
|
||||
ob_clean();
|
||||
fm_component('footer', [
|
||||
'external' => true,
|
||||
'scripts' => [
|
||||
'//blog.flash.moe/assets/blog.js',
|
||||
],
|
||||
]);
|
||||
$footer = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
echo json_encode([
|
||||
'header' => $header,
|
||||
'footer' => $footer,
|
||||
]);
|
||||
|
||||
return FM_HIT;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue